如何找出在T1中但不在T2中的记录? select * from t1 where a not in(select a from t2) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 回复人: laiyiling(CSDN上的流浪汉) 这语句如果是只有字段的就可以通过.对于多字段是不行的啦 回复人: skyboy0720(飞) ( ) 为什么要标识唯一性啊? select *from T1where not exists (select 1 from T2 where a = T1.a and b = T2.b ) select * from t1 where cast(a as varchar)+cast(b as varchar) not in (select cast(a as varchar)+cast(b as varchar) as aa from t2) select *from T1where not exists (select * from T2 where a = T1.a and b = T1.b ) select * from t1 bbwhere not exists (select * from t2 where a=bb.a and b=bb.b) 关于数据转换的方法 求一个插入的SQL 请各位帮忙写几条SQLServer2000的语句,谢谢!! SQL Command SQL2005手工执行DTS 操作步骤请教 请帮忙xp_cmdshell的怪问题! 求一分页SQL语句(在线等) 怎么查询所需的行的信息(比如在结果中只要前3行或者是中间的10-15行) 在存储过程中如何为输出参数设置不止一行的数据 一个语句的问题 大家帮我看看这个sql语句应该怎么写啊,在线等 求助!!高手进来
对于多字段是不行的啦
为什么要标识唯一性啊?
from T1
where not exists (select 1 from T2 where a = T1.a and b = T2.b )
from T1
where not exists (select * from T2 where a = T1.a and b = T1.b )
where not exists (select * from t2 where a=bb.a and b=bb.b)