删除数据问题!! delete t2 where column2 in (select column2 from t1)试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 一个表: 我想删除对应表数据!! t1: column1 column2 1 a 2 b 3 c 4 d 5 e t2: column1 column2 column3 1 a 342 2 b 2 3 c 523 4 d 52 5 e f 6 f gr4 7 g 435 8 h 43 9 i 45 想用一句SQL将t2中对应column1,2 在t1 的column1,2 相等的记录删除! 怎样写??? 不行!!因为column2值不唯一!对应两个字段才行。 对应两个字段才行。是什么意思??!因为column2值不唯一又有什么影响?! delete from t2 where (cast(t2.column1 as varchar(20)) + t2.column2) in (select (cast(t1.column1 as varchar(20)) + t1.column2) from t1) delete from t2 where t2.column1 = t1.column1 and t2.column2 = t1.column2这样不行吗? 呵呵!!是不合语法,立刻悔改。DELETE FROM t2WHERE column1 = (select column1 from t1) and column2 = (select column2 from t1)Go senzz(森):hehe还是不合语法,你混淆了一些概念,可能你还没清楚,只是当然 senzz(森):只是想当然,单独的某行某列的值怎么能和一个集合相比较呢?? delete t2 from t1,t2 where t2.column1 = t1.column1 and t2.column2 = t1.column2这样行不? 简单临时表问题 如何用存储过程执行excel导入数据到mssql表中 在SQL Server 2000中,如何判断字符串为空? win7下数据库文件复制不了 sql一个有意思的问题,希望能得到理论上的支持 如何把一个表中的数据按要求导入到另外一个表中 高分提问 SQL SERVER事务处理的问题 sql server数据库中,text类型的值如何只读取他前面的10个字符?是不是很难?拜托了 找不到适合的查询方法,请赐教。 有些复杂的函数问题。。。 如何把Access数据库导入SQL server数据库中?
我想删除对应表数据!!
t1:
column1 column2
1 a
2 b
3 c
4 d
5 e
t2:
column1 column2 column3
1 a 342
2 b 2
3 c 523
4 d 52
5 e f
6 f gr4
7 g 435
8 h 43
9 i 45
想用一句SQL将t2中对应column1,2 在t1 的column1,2 相等的记录删除!
怎样写???
对应两个字段才行。
因为column2值不唯一又有什么影响?!
WHERE column1 =
(select column1 from t1) and column2 =
(select column2 from t1)
Go
这样行不?