Re: [HACKERS] Outer joins - Mailing list pgsql-hackers

From Kaare Rasmussen
Subject Re: [HACKERS] Outer joins
Date
Msg-id 199906050658.IAA17164@bohr.webline.dk
Whole thread Raw
In response to Re: [HACKERS] Outer joins  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
> Left outer joins will take the left-side table and null-fill entries
> which do not have a corresponding match on the right-side table. If
> your example is trying to get an output row for at least every input
> row from t1, then perhaps the query would be
> 
> select * from t1 left join t2 using (x)
>                  left join t3 using (x)
>                  left join t4 using (x);
> 
> But since I haven't implemented it yet I don't have much experience
> with the outer join syntax...

You miss at least two points: The keyword OUTER and the column name
from t1. As I know, LEFT is the default, so it could be omitted.

Maybe
SELECT * FROM t1 USING (X) OUTER JOIN t2 USING (Y)OUTER JOIN t3 USING (Z)OUTER JOIN t4 using (t);

It should be possible to boil it down to
SELECT * FROM t1 USING (X) OUTER JOIN t2 USING (Y), t3 USING (Z), t4 using (t);





pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: Re: [HACKERS] Priorities for 6.6
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Priorities for 6.6