pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph Shraibman <jks@selectacast.net>
To: depesz@depesz.pl
Cc: PGSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: subselects
Date: Wed, 06 Dec 2000 15:23:22 -0500
Message-ID: <3A2EA03A.D36F74B2@selectacast.net> (raw)
References: <3A259958.D6C578D5@selectacast.net>
	<20001202112723.A29244@gruby>

hubert depesz lubaczewski wrote:
> 
> 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
> 

Because in my case I'm dynamically generated the select by passing in
some String values, which are inserted into SELECT x,x,x from mytable so
I can't do a simple join.

-- 
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio.  http://www.targabot.com



view thread (5+ messages)  latest in thread

Message-ID: <3A2EA03A.D36F74B2@selectacast.net>
Permalink:  ../3A2EA03A.D36F74B2@selectacast.net/
Also on:    postgresql.org/message-id/3A2EA03A.D36F74B2@selectacast.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jks@selectacast.net, depesz@depesz.pl
  Subject: Re: subselects
  In-Reply-To: <3A2EA03A.D36F74B2@selectacast.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox