查询 每个班级英语成绩最高的前两名的记录
原文:https://www.cnblogs.com/hxfcodelife/p/10226934.html
select a.Classid,a.English from (select Classid,English,row_number() over(partition by Classid order by English desc) as n from CJ) a where n<=2
另外一种情况:取组内最新的数据
select max(create_time),order_id from ycej_loan_info where order_id <> '' group by order_id