mysql group by分组排序

先内部使用order by方式排好序+LIMIT 99999999,外层再用group by分组

例如

SELECT a.* FROM (SELECT id,PersonName,TIME,X,Y,Z,createtime FROM person_position ORDER BY TIME DESC LIMIT 99999)a GROUP BY a.PersonName

 

posted @ 2021-12-24 16:31  _Lawrence  阅读(713)  评论(1编辑  收藏  举报