Group by 内部排序

1、right join

   #  update_time  gid=>sid, group_status => s_table

 select a.* from comment as a right join (select user_id, max(addtime) as maxtime from comment where user_id is not null group by user_id) as b on a.user_id=b.user_id and a.addtime=b.maxtime order by a.user_id asc;

原文地址:https://www.cnblogs.com/cbugs/p/9349248.html