-- 子查询解决方案 select * from (select id,name from `test` order by `date` desc) as `temp` group by category_id order by `date` desc;