SQL面试50题-24
链接:https://zhuanlan.zhihu.com/p/43289968
24、查询学生平均成绩及其名次(同19题,重点)
SELECT s_id,AVG(s_score) AS avg_score, ROW_NUMBER() OVER (ORDER BY AVG(s_score) DESC) FROM Score GROUP BY s_id
链接:https://zhuanlan.zhihu.com/p/43289968
24、查询学生平均成绩及其名次(同19题,重点)
SELECT s_id,AVG(s_score) AS avg_score, ROW_NUMBER() OVER (ORDER BY AVG(s_score) DESC) FROM Score GROUP BY s_id
相关推荐