27,579
社区成员
发帖
与我相关
我的任务
分享
select * from a where checksum(a,b) not in(select checksum(a,b) from b )
-->生成测试数据
declare @A table([a] int,[b] int,[c] int)
Insert @A
select 1,1,1 union all
select 1,2,2 union all
select 2,1,3
--Select * from @A
declare @B table([a] int,[b] int,[c] int)
Insert @B
select 1,1,1 union all
select 1,2,2
--Select * from @B
select * from @a a
where not exists (select 1 from @b where [a] = a.[a] and [b] = a.[b])
/*
a b c
----------- ----------- -----------
2 1 3
*/