select exam_id,duration,release_time from examination_info where exam_id in (select exam_id from (select t2.exam_id ,duration ,timestampdiff(second,start_time,submit_time) as tm ,row_number()over(partition by t2.exam_id order by timestampdiff(second,start_time,submit_time)) as rk ,count(*)over(partition by t2.exam_id ) as cnt from exam_record as t2 join examination_info as t1 using(exam_id) where score is not null) as t where rk=2 or rk=cnt-1 group by exam_id,duration having(max(tm)-min(tm)>duration*30) ) order by exam_id desc
点赞

相关推荐

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