Re: subselects - Mailing list pgsql-sql

From hubert depesz lubaczewski
Subject Re: subselects
Date
Msg-id 20001202112723.A29244@gruby
Whole thread Raw
In response to subselects  (Joseph Shraibman <jks@selectacast.net>)
List pgsql-sql
On Wed, Nov 29, 2000 at 07:03:36PM -0500, Joseph Shraibman wrote:
> I tried to do this:
>  SELECT r , a , (SELECT u , re FROM dir WHERE u = a) , cdate FROM rep
> WHERE m IN(190);

why dont you use simple join?
like:
select rep.r, rep.a, rep.cdate, dir.u, dir.re from rep, dir where rep.m in
(190) and rep.a = dir.u;

this should (i guess) work perfectly

depesz

-- 
hubert depesz lubaczewski
------------------------------------------------------------------------    najwspanialszą rzeczą jaką dało nam
nowoczesnespołeczeństwo,     jest niesamowita wręcz łatwość unikania kontaktów z nim ...
 


pgsql-sql by date:

Previous
From: "Edipo E. F. Melo"
Date:
Subject: Re: I can be a BUG?
Next
From: Jan Wieck
Date:
Subject: Re: Rules with Conditions: Bug, or Misunderstanding