好象 mysql 中还没有这个功能.另一种苯方法是:
在表中加个expdate(过期时间) 字段.
插入数据时,把这个字段初始化为 (当前时间 + 保留时间)
写个删除过期数据的脚本: delete from test.tab where expdate <= now()
在你的系统中定期自动调用这个脚本.
:)
在表中加个expdate(过期时间) 字段.
插入数据时,把这个字段初始化为 (当前时间 + 保留时间)
写个删除过期数据的脚本: delete from test.tab where expdate <= now()
在你的系统中定期自动调用这个脚本.
:)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货