每天凌晨自动执行一个sql: update tb set 该退款=1 where 该退款=0 and 已退款=0 and 未成交 and 购买日期<=getdate()-7
每天凌晨自动执行一个sql: insert tb今天可能会退款 select ... from tb where 该退款=0 and 已退款=0 and 未成交 and 购买日期 <=getdate()-6然后每分钟执行: update tb set 该退款=1 where 该退款=0 and 已退款=0 and 未成交 and id in (select id from tb今天可能会退款 where 购买日期 <=getdate()-7)
update tb set 该退款=1 where 该退款=0 and 已退款=0 and 未成交 and 购买日期<=getdate()-7
insert tb今天可能会退款 select ... from tb where 该退款=0 and 已退款=0 and 未成交 and 购买日期 <=getdate()-6然后每分钟执行:
update tb set 该退款=1
where 该退款=0 and 已退款=0 and 未成交 and id in (select id from tb今天可能会退款 where 购买日期 <=getdate()-7)
这是支付宝的dba的博客
可以去问他。