Re: very big problem with NULL - Mailing list pgsql-general

From Rene Pijlman
Subject Re: very big problem with NULL
Date
Msg-id g132it43h7uc3se0hhcmed89993kbdk76a@4ax.com
Whole thread Raw
In response to Re: very big problem with NULL  (missive@frontiernet.net (Lee Harr))
List 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 by date:

Previous
From: Marcel Gsteiger
Date:
Subject: Re: postgres 7.1 security problem?
Next
From: "Dan"
Date:
Subject: copy/backup database