Lesson 6 / 37 · Conditions and NULL

NULL is not FALSE, and it is not TRUE either

Order 108 has no amount. amount > 10 is neither true nor false for it, so it shows ∅ and the row is dropped anyway. Only TRUE keeps a row. This is the most common reason for a "missing" row.

The query

SELECT id, amount
FROM orders
WHERE amount > 10

Try WHERE amount > 10 OR amount IS NULL: order 108 is kept, because the second test is TRUE for it.

Next: Testing for NULL needs IS NULL · All lessons