Re: NULL in IN clause

Поиск
Список
Период
Сортировка
От Terry Fielder
Тема Re: NULL in IN clause
Дата
Msg-id 4356AF8C.80709@ashtonwoodshomes.com
обсуждение исходный текст
Ответ на NULL in IN clause  (Havasvölgyi Ottó <h.otto@freemail.hu>)
Список pgsql-sql

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 returned.  Ever.

Terry
> 
> 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 searched our list archives?
> 
>               http://archives.postgresql.org
> 

-- 
Terry Fielder
terry@greatgulfhomes.com
Associate Director Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
Fax: (416) 441-9085


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

Предыдущее
От: Havasvölgyi Ottó
Дата:
Сообщение: NULL in IN clause
Следующее
От: David Dick
Дата:
Сообщение: Re: NULL in IN clause