sql执行顺序优先级
时间: 2023-08-19 09:11:01 浏览: 173
回答: SQL语句的执行顺序可以简单地总结为以下几个步骤:首先是FROM和JOINs,确定数据源表和连接类型;然后是ON,指定连接条件;接下来是WHERE,筛选条件;然后是GROUP BY,按照指定字段进行分组;然后是HAVING,对分组结果进行筛选;然后是SELECT DISTINCT,选择要查询的字段;然后是ORDER BY,按照指定字段进行排序;最后是LIMIT,限制返回的结果数量。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* *3* [SQL执行顺序的优先级](https://blog.csdn.net/weixin_44912627/article/details/124290069)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [SQL语句执行顺序【全】](https://blog.csdn.net/weixin_52938172/article/details/120683734)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文