https://www.cnblogs.com/helianthus33/p/10169182.html
在centos 里面编辑好不方便
草
分组排序功能
select * from
(
select subject,name,score,ROW_NUMBER() over(PARTITION by subject order by score desc) as num from score
) T where T.num <= 3 order by subject
-----
T.num<=3 意思是每组取出三个 结果
----------------------
最后的 结果是各个课程杂乱交替,所以要对subject进行排序row_number 函数整理
原文:https://www.cnblogs.com/tangsonghuai/p/11438279.html