LEFT OUTER JOIN problem

From: Ludek Finstrle <xfinstrl(at)informatics(dot)muni(dot)cz>
To: pgsql-sql(at)postgresql(dot)org
Subject: LEFT OUTER JOIN problem
Date: 2001-09-21 13:32:00
Message-ID: 20010921153200.M19935@anxur.fi.muni.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)fi(dot)muni(dot)cz) as I'm not in list.

Thanks

Luf

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Barrett 2001-09-21 14:44:09 select is fast, update based on same where clause is slow
Previous Message Andy Hibbins 2001-09-21 00:22:18 Re: getting some tech skills?