Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Comparing data between 2 tables...

Re: Comparing data between 2 tables...

From: Andrew Allen <andrew.allen_at_sppaammkiller.handleman.com>
Date: Tue, 04 Mar 2003 17:40:28 GMT
Message-ID: <3E64D805.2030001@sppaammkiller.handleman.com>

Joe wrote:
> Hello,
>
> Can someone please give me some tips on a simple way to compare all
> columns and data on 2 tables in separate schemas in the same instance?
>
> I want to create a comparison report of, for example, MY.TABLE_SAL
> -vs- THEIR.TABLE_SAL. I want to make sure that when I load Joe
> Millionaires annual salary of $19,000 in MY.TABLE_SAL via sqlldr, they
> also take the full $19000 and not just $1900 when they extracted the
> data to be loaded into production.
>
> P.S. I'm not a DBA, so if some kind of DBA privies are needed for some
> kind of tool or Data Dictionary table, please let me know.
>
> Any tips provided is appreciated.
>

Dead easy, if I understand what you want correctyl:

CREATE
  TABLE diff_table

     AS SELECT *    -- all rows in my that do not occur in their
          FROM ( SELECT * FROM my.table_sal
                  MINUS
                 SELECT * FROM their.table_sal )
        UNION ALL
          SELECT *  -- all rows in their that do not occur in my
          FROM ( SELECT * FROM their.table_sal
                  MINUS
                 SELECT * FROM my.table_sal );
--
HTH,
AjA
Received on Tue Mar 04 2003 - 11:40:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US