一条select语句的执行阶段是有顺序的
select <select>
from <table> [<left right join> <talbe> on <on>]
where <where>
group by <group>
having <having>
order by <order>
limit <limit>
其中的执行顺序是
from 阶段 > where 阶段 > group by 阶段 > having 阶段 > select 阶段 >order by 阶段 > limit 阶段