try: select A.* from A left join B on A.id=B.id and A.name=B.name where B.id is null
select * from A where not exists(select top 1 0 from B where A.ID=B.ID)
select * from A AS A where not exists(select * from B where A.id=id and A.name=name)
select A.* from A left join B on A.id=B.id and A.name=B.name where B.id is nullselect * from A where not exists(select top 1 * from B where A.ID=B.ID)这两个都可以.
用CheckSum()最简单:select * from A where checksum(*) not in (select checksum(*) from B)
--前提:表中不能有text、ntext、image、cursor 数据类型的字段。用CheckSum()最简单:select * from A where checksum(*) not in (select checksum(*) from B)
select A.* from A left join B on A.id=B.id and A.name=B.name where B.id is null
select * from A
where not exists(select top 1 0 from B where A.ID=B.ID)
where not exists(select * from B where A.id=id and A.name=name)