日期:2014-05-18  浏览次数:20461 次

表A,表B结构完全相同,用什么语句可以找到表A有表B没有的记录?
谢谢,20分拿去

------解决方案--------------------
select * from a
where not exists (
select 1 from b
where key=a.key
)


------解决方案--------------------
--前提,不能有数据类型 text、ntext、image、cursor

select *
from A
where checksum(*) not in (select checksum(*) from B)