Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Comparing Tables?
This will work only if both tables can not have duplicate rows. MINUS returns all distinct rows selected by the first query but not the second. Therefore if table 1 contains row A n times and table 2 contains it m times your solution will assume both tables are identical.
Solomon Yakobson.
In article <346af55d.12422225_at_69.0.9.9>,
tim.hall_at_spam.begone wrote:
>
> On Thu, 13 Nov 1997 08:34:30 GMT, mhunter_at_iadfw.net (M. Hunter) wrote:
>
> > Is there an Oracle command or utility to compare the data in 2
> >tables (same structure) and report any differences.
> > Thanks in Advance
>
> Try
>
> SELECT * FROM table1
> MINUS
> SELECT * FROM table2;
>
> followed by
>
> SELECT * FROM table2
> MINUS
> SELECT * FROM table1;
>
> Of course, if the tables aren't exactly identical, with the columns
> created in the same order, you will have to replace '*' with the
> column list.
> -----------------------------------------------------
> Tim Hall, Indus International (was TSW International)
>
> http://www.tswi.com
> http://www.indusgroup.com
>
> Replace domain name with the domain from the first URL before replying via email!
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Thu Nov 13 1997 - 00:00:00 CST
![]() |
![]() |