IS NOT NULL

Tests whether a value is present, as in WHERE return_date IS NOT NULL.

sql
SELECT * FROM rental
WHERE return_date IS NOT NULL;

When to use

Use it instead of <> NULL, which never matches. PP 04 Q5 shows why NULL handling matters: a scalar subquery returns NULL where an INNER JOIN would drop the row.

See Read 01.

Appears in

No references yet.