NULL
DraftNULL means missing or unknown. That makes it different from an empty string, zero, or false, and it changes how comparisons work.
Find missing values
Use IS NULL because NULL means unknown, not equal to a value.
Loaded Database:null.database-init
SELECT id, title
FROM tickets
WHERE assignee IS NULL;Loading plan...Replace NULL for display
COALESCE returns the first non-NULL value from its arguments.
Loaded Database:null.database-init
SELECT title, COALESCE(assignee, 'Unassigned') AS owner
FROM tickets
ORDER BY id;Loading plan...NULL is not equal
A comparison with NULL does not return true, so this query finds nothing.
Loaded Database:null.database-init
SELECT id, title
FROM tickets
WHERE assignee = NULL;Loading plan...