Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 27th, 2005, 02:57 PM
rockets12345 rockets12345 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 101 rockets12345 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 50 m 20 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old September 27th, 2005, 03:26 PM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 993 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 3 h 37 m 48 sec
Reputation Power: 66
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)

Reply With Quote
  #3  
Old September 28th, 2005, 01:29 PM
rockets12345 rockets12345 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 101 rockets12345 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 50 m 20 sec
Reputation Power: 5
Quote:
Originally Posted by shammat
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)

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > How to compare columns values in multiple tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway