Received: from thor.tht.net (thor.tht.net [209.47.145.4]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB6NaQq05410 for ; Wed, 6 Dec 2000 18:36:26 -0500 (EST) (envelope-from jks@selectacast.net) Received: from p1.selectacast.net (IDENT:root@p1.selectacast.net [206.41.1.251]) by thor.tht.net (8.9.3/8.9.3) with ESMTP id QAA78045 for ; Wed, 6 Dec 2000 16:25:25 GMT (envelope-from jks@selectacast.net) Received: from selectacast.net (IDENT:jks@d1 [209.219.91.66]) by p1.selectacast.net (8.9.3/8.9.3) with ESMTP id PAA09916; Wed, 6 Dec 2000 15:23:22 -0500 Message-ID: <3A2EA03A.D36F74B2@selectacast.net> Date: Wed, 06 Dec 2000 15:23:22 -0500 From: Joseph Shraibman Organization: Xtenit, Inc. http://www.xtenit.com X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.15 i686) X-Accept-Language: en MIME-Version: 1.0 To: depesz@depesz.pl CC: PGSQL-SQL Subject: Re: subselects References: <3A259958.D6C578D5@selectacast.net> <20001202112723.A29244@gruby> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200012/44 X-Sequence-Number: 375 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