Oracle – Why = NULL Does Not Work

nulloracleoracle-11g-r2

I recently realized that we need to use a special syntax IS NULL to compare a literal to NULL.

Why does = NULL not work here?

Best Answer

Take a look at PSOUG's notes on NULL. As Fabricio Araujo hinted, NULL is not really a value like the number 4 or string 'bacon strips'. In fact, NULL is untyped in the SQL language, which is why you cannot validly use it in an equality comparison. You need the special IS [NOT] NULL syntax to check if a value is NULL or not.