Does the join order matter in SQL?

前端 未结 4 664
离开以前
离开以前 2020-11-22 15:02

Disregarding performance, will I get the same result from query A and B below? How about C and D?

-- A
select *
from   a left join b
           on 

        
4条回答
  •  时光取名叫无心
    2020-11-22 15:39

    for regular Joins, it doesn't. TableA join TableB will produce the same execution plan as TableB join TableA (so your C and D examples would be the same)

    for left and right joins it does. TableA left Join TableB is different than TableB left Join TableA, BUT its the same than TableB right Join TableA

提交回复
热议问题