题解 | #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


全部评论

相关推荐

点赞 评论 收藏
分享
那一天的Java_J...:他本来公司就是做这个的,不就是正常的游戏客户端和服务器开发,软硬件联动,有啥恶心不恶心的,提前告诉你就是怕你接受不了,接受不了就没必要再往后走流程浪费时间,虽然这公司是一坨。
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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