Re: Select .... where id not in (....) returns 0 incorrectly

Поиск
Список
Период
Сортировка
От Jeremy Smith
Тема Re: Select .... where id not in (....) returns 0 incorrectly
Дата
Msg-id CAM8SmLWx8b4kZN64wR2iYtQEKuSmYEXS7E42c+D5OPxdyWx9iQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Select .... where id not in (....) returns 0 incorrectly  (Ravi Krishna <srkrishna@vivaldi.net>)
Ответы Re: Select .... where id not in (....) returns 0 incorrectly  ("J. Roeleveld" <joost@antarean.org>)
Список pgsql-general


Doesn't this usually happen if q.id contains NULL.  That is as per ANSI
standard.


Yes, there's a good description of this here:

It would be better to use NOT EXISTS:
select count(*) from snapshotlist where NOT EXISTS (SELECT FROM q WHERE q.id = snapshotlist.id);


-Jeremy

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

Предыдущее
От: Ravi Krishna
Дата:
Сообщение: Re: Select .... where id not in (....) returns 0 incorrectly
Следующее
От: "J. Roeleveld"
Дата:
Сообщение: Re: Select .... where id not in (....) returns 0 incorrectly