with t as( select *, timestampdiff(second,start_time,submit_time) as delta_t, row_number() over(partition by exam_id order by timestampdiff(second,start_time,submit_time) ) ranking_min, row_number() over(partition by exam_id order by timestampdiff(second,start_time,submit_time) desc) ranking_max fro...