如何在oracle中逐列比较两个表 [英] How to compare two tables column by column in oracle
本文介绍了如何在oracle中逐列比较两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在两个不同的数据库中有两个相似的表。
例如:my表名称为EMPLOYEE,主键为employee id。具有相同列的相同表(例如50列是在两个数据库中的avlbl和两个数据库被链接。
I have two similar tables in oracle in two different databases. For example : my table name is EMPLOYEE and primary key is employee id. The same table with same columns(say 50 columns are is avlbl in two databases and two databases are linked.
我想逐列比较这两个表,
I want to compare these two tables column by column and find out which records are not matching. i want the specific column in each row in two tables that are not matching.
推荐答案
select *
from
(
( select * from TableInSchema1
minus
select * from TableInSchema2)
union all
( select * from TableInSchema2
minus
select * from TableInSchema1)
)
$ b b
如果你想用查询
should do the trick if you want to solve this with a query
这篇关于如何在oracle中逐列比较两个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文