题解 | #SQL类别高难度试卷得分的截断平均值#
SQL类别高难度试卷得分的截断平均值
http://www.nowcoder.com/practice/a690f76a718242fd80757115d305be45
select tb1.tag ,tb1.difficulty ,round(avg(tb1.score),1) from( select er.score ,ei.tag ,ei.difficulty ,row_number() over(order by er.score desc) r1 ,row_number() over(order by er.score asc) r2 from exam_record er left join examination_info ei on er.exam_id = ei.exam_id where ei.tag = "SQL" and ei.difficulty = "hard" and er.score is not null ) tb1 where tb1.r1<> 1 and tb1.r2 <> 1;