题解 | #SQL类别高难度试卷得分的截断平均值#
SQL类别高难度试卷得分的截断平均值
https://www.nowcoder.com/practice/a690f76a718242fd80757115d305be45
SELECT b.tag AS tag, b.difficulty AS difficulty,
round((SUM(a.score) - MAX(a.score) - MIN(a.score))/(count(a.exam_id)-2),1) AS clip_avg_score
FROM exam_record a
LEFT JOIN examination_info b ON a.exam_id = b.exam_id
WHERE b.tag = 'SQL' AND b.difficulty = 'hard' and a.score is not null
GROUP BY a.exam_id;