您好,您这样:
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 使用order by 排序
select * from table order by value1,value2
根据字段value1和value2排序默认是升序
select * from table order by value1,value2 desc
按照降序排序