SQL查询语句逻辑执行顺序
- 相关推荐
-
![SQL查询语句逻辑执行顺序](https://1500zi.500zi.com/uploadfile/img/15/790/1a44594f5515910828a9e427c5eabbd8.jpg)
1.查询语句的逻辑执行顺序
执行1:from
执行2:on
执行3:join
执行4:where
执行5:group by
执行6:having
执行7:select
执行8:distinct
执行9:order by
执行10:top
2.实际写查询语句的顺序
执行7:select
执行8:distinct<select_list>
执行1: from<left_table>
执行3:<join_type>join<right_table>
执行2:on<join_condition>
执行4:where<where_condition>
执行5:group by<group_by_list>
执行6:having<having_condition>
执行9:order by<order_by_condition>
执行10:top<limit_number>
本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。