mysql 分组查询并取出各个分组中时间最新的数据

表  t_user_info

id  groupid  content  lasttime

select  *  from t_user_info t where not exists

(select * from t_user_info where groupid= t.groupid and t.lasttime<lasttime)

原文地址:https://www.cnblogs.com/isawu/p/10916786.html