with t1 as(select exam_id, timestampdiff(second, start_time, submit_time) df1, row_number() over(partition by exam_id order by timestampdiff(second, start_time, submit_time) desc) rk1 from exam_record where submit_time is not null), t2 as(select exam_id, timestampdiff(second, start_time, submit_time) df2, row_number() over(partition by exam_id order by timestampdiff(second, start_time, submit_time)) rk2 from exam_record where submit_time is not null) select exam_id, duration, release_time from t1 join t2 using(exam_id) join examination_info using(exam_id) where rk1 = 2 and rk2 = 2 and (df1-df2)*2>=duration*60 order by 1 desc;
3

相关推荐

不愿透露姓名的神秘牛友
12-17 17:40
点赞 评论 收藏
分享
11-27 14:21
同济大学 Java
卢来猴祖:给了这薪资关键拿不了几个月就给你踹了呀
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务