IS NULL

The test for whether a value is NULL, which works where = NULL never does.

In more detail

WHERE manager_id IS NULL finds the employees with no manager, while WHERE manager_id = NULL finds nobody. IS NOT NULL is the opposite test. After a left join, IS NULL on a right-hand key finds the rows that matched nothing.

Example

SELECT name FROM employees WHERE manager_id IS NULL;

Related terms

Taught in

References