Re: [SQL] NULL in IN clause

2005-10-19 Thread Stephan Szabo
On Wed, 19 Oct 2005, [iso-8859-2] Havasv?lgyi Ott? wrote: > Hi, > > I have just run this command on 8.0.4 : > > SELECT 'foo' WHERE 0 NOT IN (NULL, 1); > > And it resulted is zero rows. > Without NULL it is OK. > Is this a bug, or the standard has such a rule? This is standard behavior. Seeing if

Re: [SQL] NULL in IN clause

2005-10-19 Thread Tom Lane
=?iso-8859-2?Q?Havasv=F6lgyi_Ott=F3?= <[EMAIL PROTECTED]> writes: > I have just run this command on 8.0.4 : > SELECT 'foo' WHERE 0 NOT IN (NULL, 1); > And it resulted is zero rows. > Without NULL it is OK. > Is this a bug, or the standard has such a rule? This is per spec. The computation is ef

Re: [SQL] NULL in IN clause

2005-10-19 Thread David Dick
As i understand it, the use of NULL in SQL means the value of the column is unknown. Therefore that result would seem fair. Havasvölgyi Ottó wrote: Hi, I have just run this command on 8.0.4 : SELECT 'foo' WHERE 0 NOT IN (NULL, 1); And it resulted is zero rows. Without NULL it is OK. Is this

Re: [SQL] NULL in IN clause

2005-10-19 Thread Terry Fielder
Havasvölgyi Ottó wrote: Hi, I have just run this command on 8.0.4 : SELECT 'foo' WHERE 0 NOT IN (NULL, 1); 0 <> NULL (Indeed nothing equals NULL, other then sometimes NULL itself) 0 <> 1 Therefore, the statement: 0 NOT IN (NULL, 1) Should always equate to false. Therefore No rows retur

[SQL] NULL in IN clause

2005-10-19 Thread Havasvölgyi Ottó
Hi, I have just run this command on 8.0.4 : SELECT 'foo' WHERE 0 NOT IN (NULL, 1); And it resulted is zero rows. Without NULL it is OK. Is this a bug, or the standard has such a rule? Best Regards, Otto ---(end of broadcast)--- TIP 4: Have you