SQL语句优化之Sql执行顺序
1.Sql执行顺序
(1) 选择表
FROM [left_table]
(2) 链接条件
ON <join_condition>
(3) 链接
<join_type> JOIN <right_table>
(4) 条件过滤
WHERE <where_condition>
(5) 分组
GROUP BY <group_by_list>
(6) 聚合函数
AGG_FUNC(column or expression),…
(7) 分组过滤
HAVING <having_condition>
(8)选择字段
SELECT
(9) 去重
DISTINCT column,…
(10)排序
ORDER BY <order_by_list>
(11)分页
LIMIT count OFFSET count;
欢迎评论区留言指正!!!