| From: | Kaare Rasmussen <kar(at)webline(dot)dk> |
|---|---|
| To: | pgsql-hackers(at)postgreSQL(dot)org |
| Subject: | Re: [HACKERS] Outer joins |
| Date: | 1999-06-05 06:58:05 |
| Message-ID: | 199906050658.IAA17164@bohr.webline.dk |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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);
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Victoria W. | 1999-06-05 07:01:11 | livetime of a variable defined in a c-procedure (fwd) |
| Previous Message | The Hermit Hacker | 1999-06-05 04:24:13 | Re: [PATCHES] bugs in version 6.5 |