jmscott@yahoo.com (John Scott) schreef:
>select count(*) from A where b = null; /* Returns 1, ok */
>select count(*) from A where b != null; /* Returns 0 ... not ok! */
>
>What am i missing?
The documentation :-)
"To check whether a value is or is not NULL, use the constructs
expression IS NULL
expression IS NOT NULL
Do not use expression = NULL because NULL is not "equal to" NULL.
(NULL represents an unknown value, so it is not known whether two
unknown values are equal.) Postgres presently converts x = NULL
clauses to x IS NULL to allow some broken client applications (such as
Microsoft Access) to work, but this may be discontinued in a future
release."
http://www.postgresql.org/users-lounge/docs/7.1/postgres/functions-comparison.html
Regards,
René Pijlman
http://www.applinet.nl