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

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

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

SELECT uid, round(avg(score), 0)as avg_score, round(avg(took), 1)as avg_time_took from ( select exam_record.uid, exam_record.exam_id, if(submit_time is null, examination_info.duration, TIMESTAMPDIFF(MINUTE, start_time, submit_time)) as took, if(score is null, 0, score) as score from exam_record join examination_info on exam_record.exam_id = examination_info.exam_id join user_info on exam_record.uid = user_info.uid where user_info.level = 0 and examination_info.difficulty = 'hard') table1 group by uid

全部评论

相关推荐

牛客868257804号:九个中铁八个中建
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务