a表中与b表不一样的数据:
select * from a where not exists(select * from b where 工号=a.工号)b表中与a表不一样的数据:
select * from b where not exists(select * from a where 工号=b.工号)
select * from a where not exists(select * from b where 工号=a.工号)b表中与a表不一样的数据:
select * from b where not exists(select * from a where 工号=b.工号)
select * from a , b where a.工号<>b.工号
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'c:\MSOffice\Access\Samples\northwind.mdb';'admin';'mypwd', Orders)
AS a where not exists(select * from b where 工号=a.工号)
union
select * from b where not exists(SELECT a.*
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'c:\MSOffice\Access\Samples\northwind.mdb';'admin';'mypwd', Orders)
AS a where 工号=b.工号)
select * from
openrowset('Microsoft.Jet.OLEDB.4.0','x:\A.mdb';'admin';'',a) a
where not exists(select * from openrowset('MSDASQL',
'Driver=Microsoft Visual FoxPro Driver;
SourceDB=e:\VFP98\data;SourceType=DBF','select * from b') b where 工号=a.工号)b表中与a表不一样的数据:
select * from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;
SourceDB=e:\VFP98\data;SourceType=DBF','select * from b') b
where not exists(select * from openrowset('Microsoft.Jet.OLEDB.4.0',
'x:\A.mdb';'admin';'',a) a where 工号=b.工号)
union
select * from b where not exists(select * from a where 工号=b.工号)