题解 | SQL类别高难度试卷得分的截断平均值

SQL类别高难度试卷得分的截断平均值

https://www.nowcoder.com/practice/a690f76a718242fd80757115d305be45

select tag,difficulty,round(avg(score),1) as clip_avg_score
from(
select tag,difficulty,score,ec.exam_id exam_id
from exam_record ec
join examination_info ei
on ec.exam_id = ei.exam_id
where difficulty = 'hard'
and score != '(NULL)') as t2
join
(select ec.exam_id exam_id,max(score) as max,min(score) as min
from exam_record ec
join examination_info ei
on ec.exam_id = ei.exam_id
where difficulty = 'hard'
and score != '(NULL)'
group by ec.exam_id) as t1
on t1.exam_id = t2.exam_id
where score != max and score != min
group by t2.exam_id,tag,difficulty

神经病写法

全部评论

相关推荐

05-30 12:03
山西大学 C++
offer来了我跪着...:不是骗子,等到测评那一步就知道为啥这么高工资了
点赞 评论 收藏
分享
07-04 16:00
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务