得到一张表里按u_id分组,按count(id)排序,每个分组的pub_time最大的哪些记录,只取count(id)最大的4条 select a.u_id,a.name,a.u_name,a.id,a.pub_time,b.cn from mb_resource a,(select max(pub_time) as pub_time,u_id,count(id) AS cn from mb_resource where auth_status = 2 GROUP BY u_id) b wher