Re: very big problem with NULL

Поиск
Список
Период
Сортировка
От Rene Pijlman
Тема Re: very big problem with NULL
Дата
Msg-id g132it43h7uc3se0hhcmed89993kbdk76a@4ax.com
обсуждение исходный текст
Ответ на Re: very big problem with NULL  (missive@frontiernet.net (Lee Harr))
Список pgsql-general
Grant <grant@xactcommerce.com> schreef:
>However, the last time i checked,  NULL does not equal to 1, 2, 3, or
>anything else besides NULL.  Thats why I'm confused as to why SELECT column
>FROM table WHERE column != 1 also excludes NULL, because 1 does NOT  have the
>same value as NULL.

NULL is unknown. Therefore, it is unknown if NULL equals 1, and it is
also unknown if NULL does not equal 1.

   NULL = 1 --> NULL
   NULL != 1 --> NULL

That's why SQL has the special operator IS NULL and IS NOT NULL (or
NOT IS NULL, I allways forget which one).

--
Vriendelijke groet,
René Pijlman <rpijlman@spamcop.net>

Wat wil jij leren?
http://www.leren.nl/

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

Предыдущее
От: Marcel Gsteiger
Дата:
Сообщение: Re: postgres 7.1 security problem?
Следующее
От: "Dan"
Дата:
Сообщение: copy/backup database