title: Oracle Compare data between two different table
body: <p>I have two table one is having all field VARCHAR2 but other having different type for different data.</p>
  
  <p>For Example :</p>
  
  <pre><code>Table One
  ==========================
  Col 1           VARCHAR2  UNIQUE KEY
  Col 2           VARCHAR2
  Col 3           VARCHAR2
  ===========================
  
  Table Two
  ==========================
  Col One         VARCHAR2  UNIQUE KEY
  Col Two         TIMESTAMP
  Col Three       NUMBER
  ==========================
  </code></pre>
  
  <p>we are having one mapping table. it denotes which column of Table One has to compare with which column of Table Two.
  For Example</p>
  
  <pre><code>Mapping Table
  ==============================
  Table One           Table Two
  ==============================
  
  Col 1               Col One
  Col 2               Col Three
  Col 3               Col Two
  ==============================
  </code></pre>
  
  <p>Now with the help of UNIQUE KEY of TABLE ONE we have to find same row in TABLE TWO and compare rows column by column and get  changes in data.
  Currently we are using java program for comparing data row by row and column by column and getting changes between data in rows with same UNIQUE KEY. it is working fine but taking too much time as we are having 100000 records in DB.</p>
  
  <p>Now my question is : is there any way i can compare data at SQL level and get changes in data?</p>