Received: from aragorn.ics.muni.cz (aragorn.ics.muni.cz [147.251.4.33]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8LDW5e72644 for ; Fri, 21 Sep 2001 09:32:05 -0400 (EDT) (envelope-from xfinstrl@informatics.muni.cz) Received: from anxur.fi.muni.cz (12840@anxur.fi.muni.cz [147.251.48.3]) by aragorn.ics.muni.cz (8.8.5/8.8.5) with ESMTP id PAA25692 for ; Fri, 21 Sep 2001 15:32:01 +0200 (MEST) Received: (from xfinstrl@localhost) by anxur.fi.muni.cz (8.8.5/8.8.5) id PAA15438 for pgsql-sql@postgresql.org; Fri, 21 Sep 2001 15:32:00 +0200 (MEST) Date: Fri, 21 Sep 2001 15:32:00 +0200 From: Ludek Finstrle To: pgsql-sql@postgresql.org Subject: LEFT OUTER JOIN problem Message-ID: <20010921153200.M19935@anxur.fi.muni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i X-Archive-Number: 200109/260 X-Sequence-Number: 4942 Hello, I have this problem (maybe only in my head ;o)): table1: ------- id | name --------- 1 | 'blabla' 2 | 'arrrgh' table2: ------- id | table1_id | name --------------------- 1 | 1 | 'hello' table3: ------- id | table2_id | name --------------------- SELECT * FROM table1 LEFT OUTER JOIN table2 ON (table1.id = table2.table1_id) LEFT OUTER JOIN table3 ON (table2.id = table3.table2_id); This select return me only one row: 1,'blabla',1,1,'hello',NULL,NULL,NULL But I think it may return two rows: 1,'blabla',1,1,'hello',NULL,NULL,NULL 2,'arrrgh',NULL,NULL,NULL,NULL,NULL,NULL Where is the problem (in my head or in postgres)? Do you know what select statement return me what I want? Please reply to my address (xfinstrl@fi.muni.cz) as I'm not in list. Thanks Luf