怎么对比出oracle两个数据库全表数据差异

时间:2021-11-04 14:53:31
如有两张相同表结构的表:
test表:

test1表:

现在要找出两张表有差异的数据,需要用minus及union的方式查找出来,语句如下:

1
2
3
4
5
6
7
8
9

select t1.* from
(select * from test
minus
select * from test1) t1
union
select t2.* from
(select * from test1
minus
select * from test) t2;

查询结果如下,红框部分的数据就是有差异的内容。