SQL Filter criteria in join criteria or where clause which is more efficient

后端 未结 9 1608
攒了一身酷
攒了一身酷 2020-12-03 02:47

I have a relatively simple query joining two tables. The \"Where\" criteria can be expressed either in the join criteria or as a where clause. I\'m wondering which is more

9条回答
  •  攒了一身酷
    2020-12-03 03:34

    One thing I want to say finally as I notified, before that.. Both ways may give the same performance or using the criteria at Where clause may be little faster as found in some answers..

    But I identified one difference, you can use for your logical needs..

    1. Using the criteria at ON clause will not filter/skip the rows to select instead the join columns would be null based on the conditions

    2. Using the criteria at Where clause may filter/skip the rows at the entire results

提交回复
热议问题