Re: "large" IN/NOT IN subqueries result in query returning wrong data

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "large" IN/NOT IN subqueries result in query returning wrong data
Дата
Msg-id 3697.1135712691@sss.pgh.pa.us
обсуждение исходный текст
Ответ на "large" IN/NOT IN subqueries result in query returning wrong data  ("George Pavlov" <gpavlov@mynewplace.com>)
Ответы Re: "large" IN/NOT IN subqueries result in query returning wrong data  (elein <elein@varlena.com>)
Список pgsql-sql
"George Pavlov" <gpavlov@mynewplace.com> writes:
> select count(*) from t2 where t2.name not in (
>   select t1.name from t1 limit 261683) 
> --> 13
> select count(*) from t2 where t2.name not in (
>   select t1.name from t1 limit 261684) 
> --> 0

> What is so magical about 261683?

Most likely, the 261684'th row of t1 has a NULL value of name.
Many people find the behavior of NOT IN with nulls unintuitive,
but it's per SQL spec ...
        regards, tom lane


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

Предыдущее
От: "George Pavlov"
Дата:
Сообщение: "large" IN/NOT IN subqueries result in query returning wrong data
Следующее
От: John McCawley
Дата:
Сообщение: Re: "large" IN/NOT IN subqueries result in query returning