标签:group by sel inner code order by select log blog sql
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;
标签:group by sel inner code order by select log blog sql
原文地址:http://www.cnblogs.com/007sx/p/6753844.html