题解 | #删除记录(二)#
删除记录(二)
https://www.nowcoder.com/practice/964c9f7fffbb4ab18b507cfed4111b4a
本题主要难点在于首先是排序asc降序排序,其次用到limit限制符,还有就是timestampdiiff 用minute为单位必须要<5而不能<=5,因为有些时间间隔超出5分钟比如5分半也会按照5分计算,就与题目不符合了
delete from
exam_record
where
timestampdiff (minute, start_time, submit_time) < 5
or submit_time is null
order by
start_time asc
limit
3
