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

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

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

select distinct exam_id,duration,release_time
from(  select distinct exam_id,duration,release_time,
           sum(case when ranking_desc = 2 then time_cha
                    when ranking_asc = 2 then - time_cha else 0 end) as two_slow
       from  ( select exam_id,tag,duration,release_time,timestampdiff(minute,start_time,submit_time) as time_cha,
                  row_number() over(partition by exam_id order by timestampdiff(minute,start_time,submit_time) desc) ranking_desc,
                  row_number() over(partition by exam_id order by timestampdiff(minute,start_time,submit_time) asc) ranking_asc
                from examination_info a join exam_record b using(exam_id)
                where score is not null
             ) c
       group by exam_id
     ) d
where two_slow * 2 >duration
order by exam_id desc 


为啥提交报错,我真的不理解
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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