MySQL实现分组排序并取组内第一条数据

错误示范:

select t.* from (
    select * from error_record e order by e.begin_time desc
) t group by t.error_type

正确示范:

内部子查询用limit字段,可固定排序

select t.* from (
    select * from error_record e order by e.begin_time desc limit 1000
) t group by t.error_type
原文地址:https://www.cnblogs.com/xiaoliu66007/p/15474735.html