题解 | #0级用户高难度试卷的平均用时和平均得分#

0级用户高难度试卷的平均用时和平均得分

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

本题知识点 case when 和if函数的应用
select t5.uid,round(avg(score),0),round(avg(took),1)
from 
    (select t4.uid uid,
           case when score is null then 0
           else score end as score,
           if(submit_time is null,duration,timestampdiff(minute,start_time,submit_time)) as took
    from 
        (select t1.uid uid,start_time,submit_time,duration,score
        from exam_record t1
        join examination_info t2
        on t1.exam_id=t2.exam_id
        join user_info t3
        on t1.uid=t3.uid
        where level=0 and difficulty='hard'
        ) t4
    ) t5
group by t5.uid;


全部评论

相关推荐

丿南烟丶:黑白模板吧,不要这样花哨的。 主要成就太空了,和获奖融在一起,写一两行就行了。 职业技能不要这样排,就传统的掌握精通什么什么然后举例补充的一些重要技术点。 自我介绍说实话也没啥用,可以删了。 把自己的两个项目方案细节补充上去,为什么这样设计,怎么设计,成果是什么按star法则来写 你要引导面试官来问你的技能和项目,你的获奖和自我介绍别人可能看都不看一眼或者不太在乎,重要的是展示你能干活的能力
点赞 评论 收藏
分享
牛客21331815...:像我一投就pass,根本不用焦虑泡池子
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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