您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

mysql学习03-sql执行加载顺序

bubuko 2022/1/25 20:03:51 mysql 字数 1083 阅读 693 来源 http://www.bubuko.com/infolist-5-1.html

1.sql语句 select distinct <select_list> from left_table <join_type> join?right_table on <join_condition> where <where_condition> group by <group_by_list ...

1.sql语句

select distinct <select_list>

from

left_table <join_type> join right_table

on <join_condition>

where <where_condition>

group by <group_by_list>

having <having_condition>

order by <order_by_conddition>

limit <limit_num>

 

2.mysql服务器处理后的顺序

from left_table

on join_condition

join_type join right_table

where where_condition

group by group_by_list

having having_condition

select

distinct select_list

order by order_by_condition

limit limit_num

顺序:先确定要查询的表,

然后where条件过滤数据,

group by进行分组,

having条件过滤每个组中的数据,

确定要查询的字段,

对于查出来信息进行排序

限制查询数据的量。

 

mysql学习03-sql执行加载顺序

原文:https://www.cnblogs.com/joeking/p/12541983.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶