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

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

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

select exam_id, examination_info.duration, examination_info.release_time from
(select exam_id,short_time from (select exam_id, timestampdiff(second,start_time,submit_time) as short_time, row_number() over(partition by exam_id order by timestampdiff(second,start_time,submit_time) asc) as ranking from exam_record) as rank_table1
where ranking = 2) as short_time_table
join
(select exam_id,rank_table2.long_time from (select exam_id, timestampdiff(second,start_time,submit_time) as long_time, row_number() over(partition by exam_id order by timestampdiff(second,start_time,submit_time) desc) as ranking from exam_record) as rank_table2
where ranking = 2) as long_time_table
using(exam_id)
left join examination_info using (exam_id)
where (long_time_table.long_time - short_time_table.short_time) > examination_info.duration/2 * 60
order by exam_id desc

全部评论

相关推荐

07-11 11:15
中南大学 Java
好可爱的hr姐姐哈哈哈哈
黑皮白袜臭脚体育生:兄弟们貂蝉在一起,吕布开了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-07 12:04
毕业生招你惹你了,问一个发薪日来一句别看网上乱七八糟的你看哪个工作没有固定发薪日扭头就取消了面试就问了一句公司都是这个态度吗还搞上人身攻击了...
程序员小白条:呃呃呃,都还没面试,我都不会问这么细,何况通不通过,去不去都另说,你没实力和学历的话,在外面就这样,说实话没直接已读不回就不错了,浪费时间基本上
点赞 评论 收藏
分享
06-28 22:48
已编辑
广东金融学院 Java
小浪_Coding:学院本+这俩项目不是buff叠满了嘛
点赞 评论 收藏
分享
我看看你怎么个事来
牛牛爱吃草草:我看看你怎么个事来
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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