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

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

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

select a.exam_id,b.duration,b.release_time
from
(select a.exam_id,a.secondfast,b.secondslow,(b.secondslow-a.secondfast) as timeinterval
from
(select exam_id,time as secondfast
from
 (
select exam_id,time,rank() over (partition by exam_id
order by time asc) as rankk
from
(
select exam_id,timestampdiff (second, start_time, submit_time) as time
from exam_record) a
) b
where rankk = 2) a
left join 
(select exam_id,time as secondslow
from
(select exam_id,time,rank() over (partition by exam_id order by time desc) as rankk
from
(select exam_id,timestampdiff (second, start_time, submit_time) as time
from exam_record) a
) b
where rankk = 2
) b
on a.exam_id = b.exam_id) a
left join
examination_info b
on a.exam_id = b.exam_id
where timeinterval > duration*30
order by a.exam_id desc;

全部评论

相关推荐

牛客51274894...:照片认真的吗,找个专门拍证件照的几十块钱整端正点吧,要不就别加照片
点赞 评论 收藏
分享
zzzilik:没事的,才刚刚开始,后面会捞的,这个三天没人发起面试自动结束,但是面试官还是能看到简历,四月份主战场会慢慢捞
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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