Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2001

    Unanswered: Compare the data between two tables

    Hi all,

    Can any one have the code to compare two tables.. data . and report the data in which columns it is changed...

    My case is :
    Tab1 has columns 200 and Tab2 has 200 columns.
    Every day Tab1 is refreshed and Tab2 will contain the last data of Tab1.. in this case i need to compare the changed data in Tab1 comparing with the Tab2..

    Any suggestions are most welcome...


  2. #2
    Join Date
    Apr 2001
    select * from table1
    select * from table2

    will return all rows that are in table1 but not in table2.

    (So all rows that have a changed value in table 1 will show up).
    Ruud Schilders
    Oracle DBA
    e-mail :
    URL :
    Twitter :

  3. #3
    Join Date
    Jun 2002
    Depending on how many rows are in these tables, and if you have the liberty to do so, you might also consider implementing a timestamp column on both tables and an update trigger on tab1 to update the timestamp when any changes to the table (tab1) are made. If you also create an index on the primary key and this timestamp on both tables, the query may be more efficient. The drawback to this though, is that you will retrieve rows that have been changed, and then changed back to their original value. The timestamps will be off but the data may match. This does, however, have the advantage of showing which rows were active.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts