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 eB2H4vF41247 for ; Sat, 2 Dec 2000 12:05:01 -0500 (EST) (envelope-from depesz@gruby.cs.net.pl) Received: from gruby_int.cs.net.pl (cafe1.rem.pl [195.205.133.61]) by thor.tht.net (8.9.3/8.9.3) with ESMTP id GAA17749 for ; Sat, 2 Dec 2000 06:33:18 GMT (envelope-from depesz@gruby.cs.net.pl) Received: (from localhost user: 'depesz' uid#500 fake: STDIN (depesz@gruby.cs.net.pl)) by gruby.cs.net.pl id ; Sat, 2 Dec 2000 11:27:23 +0100 Date: Sat, 2 Dec 2000 11:27:23 +0100 From: hubert depesz lubaczewski To: PGSQL-SQL Subject: Re: subselects Message-ID: <20001202112723.A29244@gruby> Reply-To: depesz@depesz.pl References: <3A259958.D6C578D5@selectacast.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <3A259958.D6C578D5@selectacast.net>; from jks@selectacast.net on Wed, Nov 29, 2000 at 07:03:36PM -0500 X-Archive-Number: 200012/14 X-Sequence-Number: 345 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 ...