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

From Thomas Lockhart
Subject Re: [HACKERS] Outer joins
Date
Msg-id 3753FF09.F8035ECD@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] Outer joins  (Kaare Rasmussen <kar@webline.dk>)
Responses Re: [HACKERS] Outer joins
List pgsql-hackers
> > select * from t1 left|right|full outer join t2 on t1.x = t2.x;
> Will this be correct?
> SELECT * FROM t1, t2, t3, t4 LEFT OUTER JOIN ON t1.x = t2.x,
>  t1.x = t3.x, t1.x = t4.x;

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...
                        - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: [SQL] Column name's length
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] LIMITS