select * from (select * from tablename order by last_time desc) as t order by t.id desc
order by last_time,id desc 这种方式last_time默认是升序的
order by last_time and id desc 这种方式两个字段都是降序的
应该先分组,
select id,last_time from yourtablename group by last_time order by last_time desc,id desc
本文介绍了如何使用SQL进行高效的数据查询操作,包括对特定字段的排序、分组等实用技巧。
3528

被折叠的 条评论
为什么被折叠?



