mysql 排序问题,求助

来源:百度知道 编辑:UC知道 时间:2024/06/05 05:49:28
select time,count(*) as cnt from client_xq where time like '%2008%' and time >='2008-04-14' group by time order by cnt desc,time asc LIMIT 0,30
上面是查找出重复最多的前30个字段,整个排序的结果是按照cnt降序排列的,我现在要把这30个字段再按照时间time升序排列,该如何写?求助

select * from test where id in(3,1,5) order by find_in_set(id,'3,1,5');
select * from test where id in(3,1,5) order by substring_index('3,1,2',id,1);

select time,count(*) as cnt from client_xq where time like '%2008%' and time >='2008-04-14' group by time order by time asc

select * from
(select time,count(*) as cnt from client_xq where time like '%2008%' and time >='2008-04-14' group by time order by cnt desc,time asc LIMIT 0,30 )
order by time desc