题解 | #第二快/慢用时之差大于试卷时长一半的试卷#

第二快/慢用时之差大于试卷时长一半的试卷

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

# 1.按照exam_id分组计算用时最多和用时最少
# 2.排除用时最多和用时最少后,再分组,再计算最慢-最快(用时最多-用时最少)
# 3.试卷时长化成秒,用时也用秒表示
# 最慢-最快(用时最多-用时最少)>duration*60/2=duration*30
select exam_id,duration,release_time
from exam_record
left join 
(select exam_id
,max(timestampdiff(second,start_time,submit_time)) as maxtp
,min(timestampdiff(second,start_time,submit_time)) as mintp
,duration,release_time
from exam_record
left join examination_info using(exam_id)
where submit_time is not null
group by exam_id) as tt using(exam_id)
where submit_time is not null
and timestampdiff(second,start_time,submit_time) not in (tt.maxtp,tt.mintp)
group by exam_id
having (max(timestampdiff(second,start_time,submit_time))
-min(timestampdiff(second,start_time,submit_time)))>duration*30
order by exam_id desc

全部评论

相关推荐

但听说转正率很低,我现在有在实习了,好纠结要不要去
熬夜脱发码农:转正率低归低,但是实习的经历你可以拿着,又不是说秋招不准备了
点赞 评论 收藏
分享
Southyeung:我说一下我的看法(有冒犯实属抱歉):(1)简历不太美观,给我一种看都不想看的感觉,感觉字体还是排版问题;(2)numpy就一个基础包,机器学习算法是什么鬼?我感觉你把svm那些写上去都要好一点。(2)课程不要写,没人看,换成获奖经历;(3)项目太少了,至少2-3个,是在不行把网上学习的也写上去。
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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