热线电话:13121318867

登录
2020-10-08 阅读量: 1174
mysql运行时的执行顺序

mysql查询顺序

  1. select[distinct]

  2. from

  3. join(left join/right join/innner join等)

  4. on

  5. where

  6. group by

  7. having

  8. union

  9. order by

  10. limit

mysql执行顺序

  1. from

  2. join

  3. on

  4. where

  5. group by(开始使用select中的别名,后面的语句中都可以使用) 这里可以使用表中普通字段的别名,不能使用聚合函数的别名

  6. avg,sum....

  7. having

  8. select

  9. distinct

  10. order by

  11. limit


128.4933
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子