删除指定日期之前订单的SQL语句|7.1工具中心-sql语句执行、批量评价 - 店大侠软件官网—快递单打印软件|发货单打印软件|短信通知回访|网店进销存|自动发货 - Powered by phpwind
  • 1624阅读
  • 0回复

删除指定日期之前订单的SQL语句 [复制链接]

上一主题 下一主题
离线shopdaxia
 

只看楼主 倒序阅读 使用道具 楼主  发表于: 2021-09-22

select top_tid into #t from top_trade where top_created<'2021-5-20'
delete from top_order where top_tid in (select top_tid from #t)
delete from top_trade where top_tid in (select top_tid from #t)
delete from top_attrs where src_table='top_trade' and  src_key in (select top_tid from #t)
drop table #t
快速回复
限100 字节
 
上一个 下一个