2013年1月22日 星期二

ms-sql A 不存在 B


1.
select b.*
from b
where not exists(select 1 from a where a.id=b.id and a.bm=b.bm)
2.
select * from a where not exists(select 1 from tb where id=a.id and bm=a.bm)
3.
select * from b except select * from a
select *  from A where checksum(id, bm) not in (select checksum(id, bm)from B)
4.
select * from B
WHERE NOT EXISTS (SELECT 1 FROM A WHERE id = B.id AND bm = B.bm)
5.
select * from a where checksum(*) not in(select checksum(*) from b)

沒有留言:

張貼留言