Re: NOT IN (NULL) ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Paul" <magamos(at)mail(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: NOT IN (NULL) ?
Date: 2010-10-31 16:42:27
Message-ID: 23338.1288543347@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Paul" <magamos(at)mail(dot)ru> writes:
> Why the condition
> SELECT 5 NOT IN (NULL)
> returns NULL, but not FALSE (as I thought)?

Because the SQL standard says so.

If you think of NULL as meaning "unknown", it makes some intuitive
sense: it's unknown whether that unknown value is equal to 5.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2010-10-31 16:44:01 Re: NOT IN (NULL) ?
Previous Message Paul 2010-10-31 16:37:28 NOT IN (NULL) ?