Filtering for NULL in queries

suggest change

The syntax for filtering for NULL (that is, the absence of a value) in a WHERE clause is different from filtering for specific values.

SELECT * FROM Employees WHERE ManagerId IS NULL ;
SELECT * FROM Employees WHERE ManagerId IS NOT NULL ;

Note that because NULL is not equal to anything, not even to itself, using equality operators = NULL or <> NULL (or != NULL) will always yield the truth value of UNKNOWN which will be rejected by WHERE.

WHERE rejects rows whose condition is FALSE or UNKNOWN and keeps only rows whose condition is TRUE.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents