Re: not null - trivial, unexpected behavior

Поиск
Список
Период
Сортировка
От Rene Pijlman
Тема Re: not null - trivial, unexpected behavior
Дата
Msg-id odumit8vqilkh2l9kfiljlj88oa0e4e2fk@4ax.com
обсуждение исходный текст
Ответ на not null - trivial, unexpected behavior  (John Scott <jmscott@yahoo.com>)
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Alex Pilosov
Дата:
Сообщение: Re: Re: binary data
Следующее
От: "Mahesh Guleria"
Дата:
Сообщение: Row Level Locking !!