Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8RIMwh90945 for ; Thu, 27 Sep 2001 14:22:58 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 126925; Thu, 27 Sep 2001 11:22:55 -0700 From: "Josh Berkus" Subject: Re: LEFT OUTER JOIN problem To: Ludek Finstrle , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Thu, 27 Sep 2001 11:22:55 -0700 Message-ID: In-Reply-To: <20010921153200.M19935@anxur.fi.muni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200109/264 X-Sequence-Number: 4946 Ludek, > I have this problem (maybe only in my head ;o)): Yup. Or it's a language problem. There's a fair Czech community of PgSQL users, so hopefully you can get in touch with some of them. (Your English is better than any of my 2nd languages -- it's just that techincal docs are hard enough to understand in one's native language!) > 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 Yes, it will. The query you want is: SELECT * FROM table1 JOIN table2 ON (table1.id = table2.table1_id) LEFT OUTER JOIN table3 ON (table2.id = table3.table2_id); -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco