Re: LEFT and RIGHT JOIN

Поиск
Список
Период
Сортировка
От Misa Simic
Тема Re: LEFT and RIGHT JOIN
Дата
Msg-id CAH3i69=JMhSnPmcWgnP_xeub=2PQNqKTNCwUk0Rqzn2AAw76Wg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: LEFT and RIGHT JOIN  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: LEFT and RIGHT JOIN  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Thanks Tom,

Yes you are right... I wanted: t1 left join (t2 inner join t3)
Is there a way to "say" that? 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...)...

(But I believe my logic is wrong - because of I have tried that on different SQL engines...)

Or the only way to "say" that is to dont care is there INNER or not... Just put brackets (in head) from left to right in row how table shows in line and if you want SELECT all from 1 table make sure it is on the end of the line (in that case you will need to use RIGHT of course)? 

Thanks,

Misa 

2012/6/29 Tom Lane <tgl@sss.pgh.pa.us>
Perhaps you're confused about the syntactic binding of JOINs?
The first query is (t1 left join t2) inner join t3, while the last one
is (t3 inner join t2) right join t1, which is the same as
t1 left join (t2 inner join t3), which is not typically the same
thing as the first one, because inner joins don't associate in or out
of the nullable side of an outer join.

                       regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Ben Chobot
Дата:
Сообщение: Re: Promotion of standby to master
Следующее
От: Tom Lane
Дата:
Сообщение: Re: LEFT and RIGHT JOIN