X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 16C78D1B509 for ; Thu, 23 Oct 2003 15:36:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 69034-09 for ; Thu, 23 Oct 2003 12:35:46 -0300 (ADT) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr1.postgresql.org (Postfix) with ESMTP id 428D9D1B53C for ; Thu, 23 Oct 2003 12:35:46 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 1AChV3-000P71-0Y; Thu, 23 Oct 2003 16:35:45 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 9A23C17B84; Thu, 23 Oct 2003 16:35:44 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id DE96016666; Thu, 23 Oct 2003 16:35:43 +0100 (BST) From: Richard Huxton To: ext-thierry.templier@ccf.com Subject: Re: =?iso-8859-1?q?R=E9f=2E=20=3A=20Re=3A=20=5BSQL=5D=20Left=20outer=20join?= Date: Thu, 23 Oct 2003 16:35:43 +0100 User-Agent: KMail/1.5 References: In-Reply-To: Cc: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310231635.43348.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/308 X-Sequence-Number: 15708 On Thursday 23 October 2003 14:39, ext-thierry.templier@ccf.com wrote: > Hello, > > It doesn't work... You don't say how. By the way, please try to reply to the list as well as directly to the person. > Have you examples on left outer join on a table that is > a part of a table? THanks, richardh=# select * from ta; a | b ---+----- 1 | aaa 2 | bbb 3 | ccc (3 rows) richardh=# select * from tb; c | d ---+----- 1 | fff 3 | ggg (2 rows) richardh=# SELECT a,b,c,d FROM (SELECT a,b FROM ta) AS one LEFT JOIN (SELECT c,d FROM tb) AS two ON a=c; a | b | c | d ---+-----+---+----- 1 | aaa | 1 | fff 2 | bbb | | 3 | ccc | 3 | ggg (3 rows) -- Richard Huxton Archonet Ltd