当前位置:Gxlcms > 数据库问题 > SQL关键字的执行顺序

SQL关键字的执行顺序

时间:2021-07-01 10:21:17 帮助过:6人阅读

on join where group by having select distinct union order by

2.Mysql语法顺序,即当sql中存在下面的关键字时,它们要保持这样的顺序:

select[distinct]  
from  
join(如left joinon  
where  
group by  
having  
union  
order by  
limit  

groupby:groupby要和聚合函数一起使用

union:完全是对select的结果进行合并(默认去掉重复的记录)(想保留重复记录使用union all)

SQL关键字的执行顺序

标签:div   默认   pre   HERE   去掉   code   sel   使用   执行顺序   

人气教程排行