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

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

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

select tag,difficulty,round(avg(score),1) as clip_avg_score
from(
select tag,difficulty,score,
        row_number()over(order by score) as rn1,
        row_number()over(order by score desc) as rn2
from(
select 
t1.tag,t1.difficulty,t2.score
from 
(select exam_id,tag,difficulty from examination_info 
 where tag = 'SQL' and difficulty = 'hard')t1
join 
(select exam_id,score from exam_record where score is not null) t2
on t1.exam_id = t2.exam_id
    ) t
    )t3
where rn1 > 1 and rn2 > 1
group by tag,difficulty


全部评论

相关推荐

06-11 17:39
门头沟学院 Java
小呆呆的大鼻涕:卧槽,用户彻底怒了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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