DISTINCT name,MAX(score) AS score,MIN(time) AS Time
FROM tb_data
GROUP BY name
ORDER BY time DESC
--DISTINCT()去重
--MAX(score)取得最高成绩
--MIN(time)取得最短用时
order by cont ->order by count(*)select count(*) as cont,ctt_id from tmp GROUP BY ctt_id order by count(*) desc limit 0,20
select * from (select * from user order by date desc) as u group by u.user_id limit 0,10试试这个,这里表名用的是user,替换成你自己的吧。如果不是你想要的,可以加我百度hi好友,根据你的具体要求来解决。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)