Home » SQL & PL/SQL » SQL & PL/SQL » table content comparison
icon2.gif  table content comparison [message #234798] Thu, 03 May 2007 03:34 Go to next message
somen
Messages: 9
Registered: May 2007
Location: KOLKATA
Junior Member
There are 2 tables of identical structure. The table holds equal number of rows and and same rows(yet to beconfirmed). How do I compare the content of the tables? (i.e. to check whether each cell holds exact data item at the relatively exact position. i.e. to check that every rows are identical).
Re: table content comparison [message #234806 is a reply to message #234798] Thu, 03 May 2007 03:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64098
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
( select * from tab1 minus select * from tab2 )
union all
( select * from tab2 minus select * from tab1 )
/

Regards
Michel

Re: table content comparison [message #234810 is a reply to message #234798] Thu, 03 May 2007 03:59 Go to previous messageGo to next message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
Can you be more clear as to what you mean by (yet to be confirmed) be more precise with what you want achieve.
icon2.gif  Re: table content comparison [message #235193 is a reply to message #234810] Fri, 04 May 2007 05:05 Go to previous messageGo to next message
somen
Messages: 9
Registered: May 2007
Location: KOLKATA
Junior Member
Thanks for your reply for further clarification. Here I tried to explain it with the help of a simple example.Consider a sample table scott.emp. Now I created a dummy of it by issuing
"create table emp_dup as select * from emp".
After this, any other user can modify emp_dup any time. Thus emp_dup differs from its original version emp from which it was derived. I have to check if there is any difference in the contents of the two tables.
Re: table content comparison [message #235194 is a reply to message #234806] Fri, 04 May 2007 05:09 Go to previous message
somen
Messages: 9
Registered: May 2007
Location: KOLKATA
Junior Member
Thank you very much for the soln. It worked fine.
Previous Topic: Problem with the UTL_FILE
Next Topic: ORA-14007
Goto Forum:
  


Current Time: Fri Dec 02 12:20:56 CST 2016

Total time taken to generate the page: 0.10121 seconds