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)

posted @ 2016-06-16 19:23  卡卡不卡  阅读(186)  评论(0编辑  收藏  举报