delete from 表1 inner join 表2 where 表1.卡号=表2.卡号 and 表1.金额=表2.金额 and 表1.次数=表2.次数

解决方案 »

  1.   

    应该是delete from 表1 inner join 表2 on 表1.卡号=表2.卡号 and 表1.金额=表2.金额 and 表1.次数=表2.次数
      

  2.   

    在表1中将表2中有的记录删除delete 表1 from 表2 where 表1.卡号 =  表2.卡号在表1中有而表2中没有的记录取出生成一个新的表select * into #tmp from 表1 where 卡号 not in (select 卡号 from 表2)
      

  3.   

    1、建立级联删除关系,用卡号来建,这个删除表1就可以级联删除表2的记录
    2、select * into 新表 from 表1 where 卡号 not in (select 卡号 from 表2)
      

  4.   

    1、这个问题看错了,改正
       delete  表1 where 卡号 in (select 卡号 from 表2)
    2、select * into 新表 from 表1 where 卡号 not in (select 卡号 from 表2)
      

  5.   

    对不起,应该是(刚刚检验过了)delete 表1 from 表1 inner join 表2 on 表1.卡号=表2.卡号 and 表1.金额=表2.金额 and 表1.次数=表2.次数