Thursday, July 2, 2009

SQL Null

I am seriously confused by whatever it is that makes SQL (At least PL/SQL and T-SQL) consider null in a completely different way then anything else.

If I write a query
SELECT *
FROM table1
WHERE column1 = 0
Then of course if column1 hasn't been filled yet it won't return anything since null != 0

Sooo, then why is it that this query
SELECT *
FROM table1
WHERE column1 != 1
Won't return anything at all either.

I understand that null is not really like anything else, but to exclude it when looking for something in a certain column seems odd to me, or am I missing something?

0 comments:

Post a Comment