题解 | #考试分数(二)#
考试分数(二)
http://www.nowcoder.com/practice/f456dedf88a64f169aadd648491a27c1
用窗口函数,相当于新增一列,各科目平均分
然后外层筛选条件为 score>avg_score
select a.id ,a.job ,a.score from (select * ,avg(score) over (partition by job) as avg_score from grade) a where a.score>avg_score