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

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

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

select
uid,
format(avg(score),0) avg_score,
format(avg(timestampdiff(minute,start_time,submit_time)),1) avg_time_took
from (
    select
a.uid,
c.start_time,
case when c.submit_time is null then date_add(c.start_time,interval b.duration minute)
else c.submit_time end submit_time,
case when c.score is null then 0
else score end score
from 
exam_record c
left join 
user_info a
on c.uid=a.uid
left join examination_info b
on c.exam_id=b.exam_id
where a.level=0
and b.difficulty='hard'
 ) d
 group by uid

# group by a.uid

全部评论

相关推荐

昨天 18:39
已编辑
西安交通大学 Java
全村最靓的仔仔:卧槽,佬啥bg呢,本也是西交么
点赞 评论 收藏
分享
爱看电影的杨桃allin春招:我感觉你在炫耀
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务