Search Postgresql Archives

join condition against where with coalesce

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

The reason I need to use the coalesce is because my goal is to do it with a full join and can't use
the and condition because it is not merge-joinable.

My test with the left join showed me that with the where it doesn't give any results, while I would expect it to give me all the results in the first table.

Any thoughts?


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux