IN and subselects

From: Brook Milligan <brook(at)trillium(dot)NMSU(dot)Edu>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: IN and subselects
Date: 1998-06-29 22:28:03
Message-ID: 199806292228.QAA05019@trillium.nmsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I am having problems getting IN in WHERE clauses to work together with
subselects. That is, I want to do something like

select * from a where a.id in (select id from b where b.n = 7);

The typical outcome is that no rows are selected even though some
match the criterion. Doing the equivalent EXISTS condition will often
work, but I cannot always get it to work.

Is there a known problem with using IN?

Thanks for your help.

Cheers,
Brook

Browse pgsql-sql by date

  From Date Subject
Next Message Zsolt Varga 1998-06-30 08:20:11 Re: [SQL] Finding strings inside a field...
Previous Message James Olin Oden 1998-06-29 22:10:50 Re: [SQL] Finding strings inside a field...