SQL / PostgreSQL left join ignores “on = constant” predicate, on left table

后端 未结 1 1211
感情败类
感情败类 2020-12-21 01:56

An SQL left join query ignores an ON column = constant predicate on the left table.
However, it cares about another ON column = cons

相关标签:
1条回答
  • 2020-12-21 02:20

    The point is that the ON clause for a LEFT [OUTER] JOIN only regulates whether a row from the right table is joined.

    It does not filter rows from the left table. If you want to do that, the expression has to go into a WHERE clause (as you found out already) or the ON clause of a [INNER] JOIN.
    That's all by design.

    0 讨论(0)
提交回复
热议问题