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;