Re: Why do the two queries below return different results?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why do the two queries below return different results?
Дата
Msg-id 20000.1058676866@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Why do the two queries below return different results?  (Warren Little <wlittle@securitylending.com>)
Список pgsql-sql
Warren Little <wlittle@securitylending.com> writes:
> Look at the following two queries.
> ...
> and not exists (select pid from casecombo where casepid = secondpid)
> ...
> and casepid not in (select secondpid from casecombo)

> The second query is broken and I don't understand why.

I'll bet there are some NULL values for secondpid in casecombo.
The behavior of NOT IN with NULLs is fairly unintuitive :-(
        regards, tom lane


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

Предыдущее
От: Chris Travers
Дата:
Сообщение: SECURITY DEFINER changes CURRENT_USER?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: column doesn't get calculated - updated