Possible Duplicate:
SQL NOT IN constraint and NULL values
Why is following query not returning hello?
select 'hello' where 'a' not in ('b', null)
Possible Duplicate:
SQL NOT IN constraint and NULL values
Why is following query not returning hello?
select 'hello' where 'a' not in ('b', null)
Your query can be expanded to:
SELECT 'hello' WHERE 'a' <> 'b' AND 'a' <> NULL;
The first condition evaluates to true.
The second condition evaluates to neither true nor false because NULL is neither equal nor unequal to anything. The full WHERE clause is then: "true AND neither true nor false".