删除问题! delete from 表1 inner join 表2 where 表1.卡号=表2.卡号 and 表1.金额=表2.金额 and 表1.次数=表2.次数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该是delete from 表1 inner join 表2 on 表1.卡号=表2.卡号 and 表1.金额=表2.金额 and 表1.次数=表2.次数 在表1中将表2中有的记录删除delete 表1 from 表2 where 表1.卡号 = 表2.卡号在表1中有而表2中没有的记录取出生成一个新的表select * into #tmp from 表1 where 卡号 not in (select 卡号 from 表2) 1、建立级联删除关系,用卡号来建,这个删除表1就可以级联删除表2的记录2、select * into 新表 from 表1 where 卡号 not in (select 卡号 from 表2) 1、这个问题看错了,改正 delete 表1 where 卡号 in (select 卡号 from 表2)2、select * into 新表 from 表1 where 卡号 not in (select 卡号 from 表2) 对不起,应该是(刚刚检验过了)delete 表1 from 表1 inner join 表2 on 表1.卡号=表2.卡号 and 表1.金额=表2.金额 and 表1.次数=表2.次数 关于DateTime字段的Convert问题 简单的语句。。。 帮忙看下这个动态语句 谢谢 比较急的东西,在线等 求一段sql 编程 求一剔除相对重复纪录的SQL语句,在线等!!! 如何实现功能:客户最后发生业务时间超过一段时间后客户自动关闭 sql server 2008 jdbc驱动 一个关于表连接的问题?? 如何得到使用xp_cmdshell的输出结果? 一个很简单的问题! ★★★今天琢磨了一下SQL SERVER2000的无人值守自动化安装,取得了一点小小的心得愿意与大家一起分享.★★★
2、select * into 新表 from 表1 where 卡号 not in (select 卡号 from 表2)
delete 表1 where 卡号 in (select 卡号 from 表2)
2、select * into 新表 from 表1 where 卡号 not in (select 卡号 from 表2)