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

Home -> Community -> Usenet -> c.d.o.server -> Re: sql to see all diff between two table

Re: sql to see all diff between two table

From: antje <nastjenka_at_uswest.net>
Date: Fri, 29 Sep 2000 17:48:08 GMT
Message-ID: <8r2kkj$6mg$1@nnrp1.deja.com>

In article <39D459CB.DE0CB458_at_freemail.hu>,   Gombos Bertalan <bgombos_at_freemail.hu> wrote:
> (
> select 1, t.*
> from table1 t
> minus
> select 1, t.*
> from table2 t
> )
> union
> (
> select 2, t.*
> from table2 t
> minus
> select 2, t.*
> from table1 t
> )

Can you do just a single column comparison between the tables? for example if there is a column called "item_id" run a statement that says

select * from table1 where item_id not in(select item_id from table2)?

in my experience I would usually do primary key comparisons in this manner, to find info that was in one table and not the other. (bearing in mind I am used to sybase/mssql7, and not oracle, so this point may be moot)

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Sep 29 2000 - 12:48:08 CDT

Original text of this message

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