All the Views expressed here are my own and do not reflect opinions or views of the anyone else.All the views are tested on my testing environment and kindly test the post before applying anything on production.You can reach to me at email@example.com .
Wednesday, April 6, 2011
How to Comapare two Tables Data Difference
Comparing two table is a common task in day to day life of DBA . The Table which has to be compare may on same database or on different database . If the tables are in different database then we can use the database link to compare the two table . Let's have a look on the below tables .
SQL> select * from ( ( select * from dept1 minus // all rows that are in T1 but not in T2 select * from dept2 ) union all ( select * from dept2 minus // all rows that are in T2 but not in T1 select * from dept1 ) )