SQL JOIN where to place the WHERE condition?

前端 未结 3 736
独厮守ぢ
独厮守ぢ 2020-12-08 04:25

I have two following examples.

1. Example (WHERE)

SELECT 1
  FROM table1 t1
  JOIN table2 t2 ON t1.id = t2.id
 WHERE t2.field = true         


        
3条回答
  •  执笔经年
    2020-12-08 04:50

    I think the faster way is to put the filter in the where clause, because it will procees that filter in the where first , and then the join clause, so there will be no need of permutation of filters.

提交回复
热议问题