题解 | 删除记录(一)
删除记录(一)
https://www.nowcoder.com/practice/d331359c5ca04a3b87f06b97da42159c
日期差值函数总结:
timestampdiff():
计算两个时间的差值
函数语法:
timestampdiff(unit,start,end)
unit:时间单位,可填second/minute/hour/day/month/year
start:开始时间
end:结束时间
datediff()
计算两个日期的天数查
函数语法:
计算两个日期的天数差
datediff(end,start)
本题适用timestampdiff()函数代码:
delete from exam_record where timestampdiff(minute,start_time,submit_time)<5 and score<60;
