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

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

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

select t1.uid,round(avg(t1.score),0),round(avg(t1.submit_time),1) from (
select e2.uid,
(case when e2.submit_time is null then e1.duration else
 TIMESTAMPDIFF(minute,e2.start_time,e2.submit_time) end) as submit_time,
(case when e2.submit_time is null then 0 else e2.score end ) as score
from 
exam_record as e2 left join examination_info as e1 on e2.exam_id=e1.exam_id 
left join user_info as u1 on e2.uid=u1.uid where u1.level=0 and e1.difficulty='hard') t1 group by t1.uid 

全部评论

相关推荐

06-02 15:17
门头沟学院 Java
心爱的idea:怎么会呢 应该是打招呼有问题 问就说实习6个月全国可飞随时到岗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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