SQL执行顺序

1 select distinct s.id
2 from S s
3 join T t on s.id=t.it
4 where t.name = "ranmou"
5 group by t.mobile
6 having count(*)>2
7 order by s.create_time
8 limit 5

执行顺序为:

  1. from
  2. join on
  3. where
  4. group by
  5. having
  6. select
  7. distinct
  8. order by 
  9. limit

 

posted @ 2020-08-05 17:18  然某  阅读(84)  评论(0)    收藏  举报