easy5 pts · first answer countspostgresqlsql
NOT IN returns no rows
This query returns zero rows, though many customers have no blocked entry. The blocked table has one row where customer_id is NULL. Why?
SELECT * FROM customers WHERE id NOT IN (SELECT customer_id FROM blocked);
Discussion 0
Join free to post in the discussion.
Related questions
- Purpose of a primary keyDatabase Administrator
- INNER JOIN vs LEFT JOINDatabase Administrator
- DELETE vs TRUNCATEDatabase Administrator
- Filtering rows where a value is NULLDatabase Administrator
- COUNT(*) vs COUNT(column)Database Administrator
- What a foreign key enforcesDatabase Administrator
- WHERE vs HAVINGDatabase Administrator
- Logical vs physical backupDatabase Administrator