以学生成绩表为例子
现在要按成绩排序,每个人取前三的数据
select * from (SELECT *,ROW_NUMBER() OVER (PARTITION BY stu_name ORDER BY score desc) r FROM student) t where t.r<4
以学生成绩表为例子
现在要按成绩排序,每个人取前三的数据
select * from (SELECT *,ROW_NUMBER() OVER (PARTITION BY stu_name ORDER BY score desc) r FROM student) t where t.r<4