Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Comparing backup database with current database
In the more general case you would also need to do
select <blah>
from B
minus
select <blah>
from A
Assuming B could be a superset of A as well as the otherway around
Also MINUS doesn't work with longs.
-- Niall Litchfield Oracle DBA Audit Commission UK "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:leemdt0jc18edo2o2l8vj0bld6irsvv9m6_at_4ax.com...Received on Tue Apr 17 2001 - 03:34:23 CDT
> On Mon, 16 Apr 2001 13:40:01 -0400, "Nick Bowler"
> <Nick_Bowler_at_amsinc.com> wrote:
>
> >I have two tables - A and B. B is a copy of A made yesterday. The
tables
> >are such that rows are changed and added, never deleted. I need to
> >determine the differences between these two tables. Determining rows
added
> >is easy. However, to determine rows that are different I have had to
resort
> >to building a query along the lines of
> >
> >SELECT key
> >FROM A, B
> >WHERE A.key = B.key AND(
> > A.field1 <> B.field1
> > OR A.field2 <> B.field2
> > OR A.field3 <> B.field3 ....);
> >
> >Can anyone suggest a better way of determining if rows are different.
Note:
> >I am using Oracle 8.1.6.
> >
>
> select <anything>
> from A
> minus
> select <anything>
> from B
>
> anything must have the same datatype and rows will show when there's
> any difference.
>
> Hth,
>
>
> Sybrand Bakker, Oracle DBA