Re: NULL in IN clause

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NULL in IN clause
Дата
Msg-id 26534.1129756290@sss.pgh.pa.us
обсуждение исходный текст
Ответ на NULL in IN clause  (Havasvölgyi Ottó <h.otto@freemail.hu>)
Список pgsql-sql
Havasvölgyi Ottó <h.otto@freemail.hu> 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 effectivelyNOT (0 = NULL OR 0 = 1)NOT (NULL OR FALSE)NOT NULLNULL
ie, the result is UNKNOWN, which WHERE treats the same as FALSE.
        regards, tom lane


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

Предыдущее
От: David Dick
Дата:
Сообщение: Re: NULL in IN clause
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: NULL in IN clause