Re: join condition against where with coalesce

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: join condition against where with coalesce
Дата
Msg-id 26530.1163351604@sss.pgh.pa.us
обсуждение исходный текст
Ответ на join condition against where with coalesce  (Sim Zacks <sim@compulab.co.il>)
Список pgsql-general
Sim Zacks <sim@compulab.co.il> writes:
> Should there be any difference between:
> select * from table1 a left join table2 b on a.pk=b.fk and b.typeid=14
> and
> select * from table1 a left join table2 b on a.pk=b.fk
> where coalesce(b.typeid,14)=14

Quite a lot: every A row is guaranteed to appear in the output of the
first query, but not in the second.  Consider for instance an A row that
only joins to b row(s) having typeid 13.

            regards, tom lane

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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Why overlaps is not working
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why isn't it allowed to create an index in a schema other than public?