题解 | #SQL类别高难度试卷得分的截断平均值#
SQL类别高难度试卷得分的截断平均值
https://www.nowcoder.com/practice/a690f76a718242fd80757115d305be45
求截断平均值,按照题目的要求我们直接去掉exam_id为9001中的最高值和最低值再求平均数即可。
select tag,difficulty,t.clip_avg_score from (select round(((sum(score)-max(score)-min(score))/(count(score)-2)),1) clip_avg_score,exam_id from exam_record where exam_id=9001 and score is not null) t join examination_info e on t.exam_id=e.exam_id;