Re: Difference between ON and WHERE in JOINs

Поиск
Список
Период
Сортировка
От Jean-Christophe Boggio
Тема Re: Difference between ON and WHERE in JOINs
Дата
Msg-id 5059E743.5070204@thefreecat.org
обсуждение исходный текст
Ответ на Re: Difference between ON and WHERE in JOINs  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Le 19/09/2012 17:08, Merlin Moncure a écrit :
> SELECT * FROM foo LEFT JOIN BAR ON foo.id = bar.id AND bar.col = 'something';
>
> The difference here is that the filtering is now happening at join
> time where the left join semantics are playing: always return foo and
> return bar rows if and only if the join condition is met.

Ok, as a rule of thumb, should I put in the where clause only the
conditions related to foo and inner joins ? All other (outer) conditions
should then go on their respective 'ON' clauses ?

JC


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

Предыдущее
От: Jean-Christophe Boggio
Дата:
Сообщение: Re: Difference between ON and WHERE in JOINs
Следующее
От: Robert Sosinski
Дата:
Сообщение: Re: Time-based trigger