mysql分组取每组大的记录
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql分组取每组大的记录相关的知识,希望对你有一定的参考价值。
SELECT a.* FROM chat_log a INNER JOIN (SELECT id,MAX(id) id_,to_user FROM chat_log GROUP BY to_user)b ON a.to_user=b.to_user AND a.id=b.id ORDER BY a.to_user;
以上是关于mysql分组取每组大的记录的主要内容,如果未能解决你的问题,请参考以下文章