SQL点点滴滴_DELETE小计

惨痛的教训:

  某次在执行delete时,一时疏忽忘记写where条件了,

1、删除tb_mobile_cust_micromsg中的内容,前提是c_customer这个字段的值与#datamod表中c_userno这个字段的值相等。

  delete from tb_mobile_cust_micromsg

  where tb_mobile_cust_micromsg.c_customer in (select C_USERNO from #datamod where #datamod.C_USERNO=tb_mobile_cust_micromsg.c_customer)

原文地址:https://www.cnblogs.com/Zeros/p/5592004.html