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

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

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

select
id exem_id
,max(duration) duration
,max(release_time) release_time
from(
select
ei.exam_id id
,row_number()over(partition by ei.exam_id order by (submit_time-start_time)) rk1
,row_number()over(partition by ei.exam_id order by (submit_time-start_time) desc) rk2
,submit_time-start_time len
,duration
,release_time
from examination_info ei join exam_record er on ei.exam_id=er.exam_id
where score is not null) as a
group by id
having (sum(if(rk2=2,len,0))-sum(if(rk1=2,len,0)))>0.5*max(duration)
order by exem_id desc

全部评论

相关推荐

06-10 18:55
已编辑
西安电子科技大学 Java
只管努力就好:恭喜恭喜恭喜,我都没有面试机会,上周被压力炸了,今天中午看页面显示被捞进入评估结果下午就没了
京东三面373人在聊
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
今天 11:29
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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