orderby与groupby同时使用

两个同时使用:要求排序其他字段

select c1,max(c2) as a from table group by c1 order by a;

in查询按照排序结果:

select * from table order by field(c1,1,2,3,4....)
原文地址:https://www.cnblogs.com/tripChao/p/8391098.html