Mark Stosberg <[EMAIL PROTECTED]> writes:
> Tonu, thanks for the explanation. I still prefer the way Postgres
> handles it:
>
> Mark=> select * from t where c2 = null;
> c1 | c2
> ---+----
> 1 |
> (1 row)
Postgres is incorrect in doing this. At least, it's way non-standard.
NULL is *NOT* a value. It's an absence of a value, and doing *any*
comparisons with NULL is invalid (the result must always be NULL, even if
you say "foo = NULL").
The only operator you can use is "IS NULL" (or the opposite IS NOT NULL),
which simply says whether the column has a value or not.
--
Shankar.
P.S. This is certainly the interpretation *I* have seen all DBs put on NULL
comparisons. Oracle, MySQL and MSSQL in particular.