|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to compare columns values in multiple tables
I am trying to get into PL/SQL and am learning. I have table i.e TEST with 4 columns (col1,col2,col3,col4) that's on multiple DB's where col1 contains a unique key.
How can I compare the values in both the tables if they are same or not based on the unique key. Any help is appreciated. Thanks |
|
#2
|
|||
|
|||
|
What do you mean with "multiple DB's"??
Different schemas (=user)? Different Oracle instance? Different phyiscal servers not connected with each other? Different tables? If you happen to mean "TABLE" instead of "DB", then simply do a Code:
SELECT table_b.*
FROM table_a, table_b
WHERE table_a.key = table_b.key
AND (table_a.col1 <> table_b.col1 OR
table_a.col2 <> table_b.col2)
|
|
#3
|
|||
|
|||
|
Quote:
I mean I have same set of tables on multiple DB instances. As the tables are same so the data needs to be consistent too so want to find out if there's any data inconsistency comparing the tables values. I am checking on 4 tables for any data inconsistency and missing data. How can I know what data is missing or inconsistent in what table. Thanks |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > How to compare columns values in multiple tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|