bug_x

导航

 

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;

posted on 2018-07-22 10:08  bug_x  阅读(229)  评论(0编辑  收藏  举报