Filtering using the JOIN instead of WHERE

前端 未结 6 1096
别那么骄傲
别那么骄傲 2021-01-11 16:49

In SQL (MSSQL, Oracle, etc., whatever), when joining tables, what is the gain from adding a filter to the JOIN statement instead of having it in the WHERE clause?

i.

6条回答
  •  悲&欢浪女
    2021-01-11 16:55

    As a human (rather than an optimizer) myself, when maintaining a query I would look for a join condition in the JOIN clause and a search condition in the WHERE clause.

    Of course, you need to strike a balance between performance issues and code maintenance issues. However, my first priority is good logical code in the first instance then optimize as necessary.

提交回复
热议问题