mysql查询处理顺序

http://zhangzhaoaaa.iteye.com/blog/1689412参考:《MYSQL技术内幕SQL编程》

select distinct <selectlist>

from lefttable

<join-type>join <righttable>

on <join_condition>

where<where_condition>

group by<groupbylist>

with{CUBE|ROLLUP}

HAVING<havingcondition>

order by<orderbylist>

limit<limitnumber>

处理顺序

  1. from
  2. on
  3. join
  4. where
  5. group by
  6. cube|rollup
  7. having
  8. select
  9. distinct
  10. order by
  11. limit
原文地址:https://www.cnblogs.com/svennee/p/4084506.html