如果time是date型,直接group by max取出来即可
select a.id, a.status, a.time
from A, (select status, max(time) time from A group by A.status) B
where A.status = B.status
and A.time = B.time;
order by 总是放在sql语句的最后。你这个直接对time字段进行order by 就可以了呀。降序排列。