delete from exam_record where (start_time is not null and submit_time is null) or timestampdiff(minute, start_time, submit_time) < 5 order by start_time asc limit 3;
删除delete from 也可以用order by
limit 两种方式:
1. limit N 提取前N行记录
2.limit N, M(分页) 从N+1开始显示M个数据。
妙用:提取第Kth大(小)的值 可以运用 limit Kth-1,1