Re: subselects

From: hubert depesz lubaczewski <depesz(at)depesz(dot)pl>
To: PGSQL-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: subselects
Date: 2000-12-02 10:27:23
Message-ID: 20001202112723.A29244@gruby
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 nowoczesne społeczeństwo,
jest niesamowita wręcz łatwość unikania kontaktów z nim ...

In response to

  • subselects at 2000-11-30 00:03:36 from Joseph Shraibman

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Marcin Mazurek 2000-12-02 15:18:55 rules on select - different output
Previous Message Roberto Mello 2000-12-02 06:09:04 Re: I can be a BUG?