sql server检查里个表的数据是否相同

2021-06-28  本文已影响0人  DH东海

select * into #aa
from tableName where id=75653
select * into #bb
from tableName where id=75653
union all
select *
from tableName where id=75653
--不去重
select * from #aa
INTERSECT
select * from #bb
--自动去重
select * from #aa
except
select * from #bb

上一篇下一篇

猜你喜欢

热点阅读