delete from exam_record where id in ( select t.id from ( select *,ROW_NUMBER()over(order by start_time) as m from exam_record where TIMESTAMPDIFF(minute,start_time,submit_time)<5 &nbs***bsp; submit_time is null ) as t where t.m<=3 ) 复杂的方法,窗口函数加WHERE筛选条件