gotchaModerate
Why does = NULL not work in Oracle?
Viewed 0 times
whynullworkdoesoraclenot
Problem
I recently realized that we need to use a special syntax
Why does
IS NULL to compare a literal to NULL.Why does
= NULL not work here?Solution
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.Context
StackExchange Database Administrators Q#4291, answer score: 13
Revisions (0)
No revisions yet.