from table where condition1 group by field1 having condition2 order by field2 [asc/desc] limit amount;
如上sql,执行的顺序为:
from
where
group by
聚合函数(如,count(),sum())
having
order by
limit
from table where condition1 group by field1 having condition2 order by field2 [asc/desc] limit amount;
如上sql,执行的顺序为:
from
where
group by
聚合函数(如,count(),sum())
having
order by
limit
转载于:https://my.oschina.net/kevin2kelly/blog/1634114