删除3天前数据
delete from liuyan where datediff(curdate(), time) > 3
DATEDIFF() 函数返回两个日期之间的天数。
例子:
SELECT DATEDIFF('2008-12-30','2008-12-29') AS DiffDate
返回1
SELECT DATEDIFF('2008-12-29','2008-12-30') AS DiffDate
返回-1
CURDATE() 函数返回当前的日期。
SELECT NOW(),CURDATE(),CURTIME()