Re: [SQL] subqueries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] subqueries
Дата
Msg-id 27286.924017863@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: [SQL] subqueries  (Walt Bigelow <walt@stimpy.com>)
Список pgsql-sql
Walt Bigelow <walt@stimpy.com> writes:
> SELECT agencyid, first, last 
> FROM tbladdress
> WHERE type = 1
> AND agencyid NOT IN
>     (SELECT distinct agencylink
>     FROM tbladdress 
>     WHERE type = 2)
> ORDER BY last;

Looks reasonable ...

> This query returns 0 rows [ when it shouldn't ].

Sounds like a bug.  What version of Postgres are you running?
What do you get from "EXPLAIN"ing that query?  What are the
data types of the columns being used?
        regards, tom lane


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

Предыдущее
От: "Glenn Waldron"
Дата:
Сообщение: Trouble with null text fields
Следующее
От: Michael Davis
Дата:
Сообщение: RE: [SQL] Trouble with null text fields