Re: [SQL] subqueries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Walt Bigelow <walt(at)stimpy(dot)com>
Cc: pgsql-sql(at)hub(dot)org
Subject: Re: [SQL] subqueries
Date: 1999-04-13 15:37:43
Message-ID: 27286.924017863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Walt Bigelow <walt(at)stimpy(dot)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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Davis 1999-04-13 15:48:33 RE: [SQL] Trouble with null text fields
Previous Message Glenn Waldron 1999-04-13 15:25:37 Trouble with null text fields