X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3294E4763E6 for ; Sun, 2 Mar 2003 01:49:30 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 22501-03 for ; Sun, 2 Mar 2003 01:49:28 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 76A0E47725E for ; Sat, 1 Mar 2003 20:07:11 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 3E644D610; Sat, 1 Mar 2003 17:07:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 341FE5C04; Sat, 1 Mar 2003 17:07:09 -0800 (PST) Date: Sat, 1 Mar 2003 17:07:09 -0800 (PST) From: Stephan Szabo To: Nicolas Fertig Cc: Subject: Re: OUTER JOIN with filter In-Reply-To: <3e61011d$0$1220$5402220f@news.sunrise.ch> Message-ID: <20030301170535.U21117-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/40 X-Sequence-Number: 12080 On Sat, 1 Mar 2003, Nicolas Fertig wrote: > Can anyone help me with the problem bellow ? > > SELECT TM.some_field, TS.name > FROM table_main TM > LEFT OUTER JOIN (SELECT name FROM table_slave WHERE c1 = 'myvalue') TS > USING(id) Maybe, select tm.some_field, ts.name from table_tmain tm left outer join table_slave ts on (tm.id=ts.id and ts.c1='myvalue');