Re: [HACKERS] Outer joins
От | Kaare Rasmussen |
---|---|
Тема | Re: [HACKERS] Outer joins |
Дата | |
Msg-id | 199906050658.IAA17164@bohr.webline.dk обсуждение исходный текст |
Ответ на | Re: [HACKERS] Outer joins (Thomas Lockhart <lockhart@alumni.caltech.edu>) |
Список | 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 по дате отправления: