Re: LEFT and RIGHT JOIN - Mailing list pgsql-general

From Tom Lane
Subject Re: LEFT and RIGHT JOIN
Date
Msg-id 24369.1341009412@sss.pgh.pa.us
Whole thread Raw
In response to Re: LEFT and RIGHT JOIN  (Misa Simic <misa.simic@gmail.com>)
List pgsql-general
Misa Simic <misa.simic@gmail.com> writes:
> Yes you are right... I wanted: t1 left join (t2 inner join t3)
> Is there a way to "say" that?

Sure, just add the parentheses.

    t1 left join (t2 inner join t3 on t2-t3-condition) on t1-t2-condition

> I mean to me, it is logical and without
> brackets... i.e. t1 left join t2 inner join t3 left join t4, I would read
> as: t1 left join (t2 inner join t3) left join t4 .... (Like INNER has
> advantage on OUTER...)...

Well, that might or might not be more intuitive, but the SQL standard
says these bind equally, left to right, unless you use parens.

            regards, tom lane

pgsql-general by date:

Previous
From: Misa Simic
Date:
Subject: Re: LEFT and RIGHT JOIN
Next
From: Misa Simic
Date:
Subject: Re: LEFT and RIGHT JOIN