Home » SQL & PL/SQL » SQL & PL/SQL » How can i find if two Tables are Equal to each other? (Oracle 9I)
How can i find if two Tables are Equal to each other? [message #329907] Fri, 27 June 2008 01:00 Go to next message
renu4dwh
Messages: 24
Registered: April 2008
Location: Pune
Junior Member
Can you please tell what will be the most efficient query to find if two tables are equal to each other?

And if they are not same, then the result should show on which column the rows are differing between the two tables.

[Updated on: Fri, 27 June 2008 01:03]

Report message to a moderator

Re: How can i find if two Tables are Equal to each other? [message #329908 is a reply to message #329907] Fri, 27 June 2008 01:03 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Most of the time, "A minus B union all B minus A"

Regards
Michel
Re: How can i find if two Tables are Equal to each other? [message #330007 is a reply to message #329908] Fri, 27 June 2008 05:06 Go to previous messageGo to next message
renu4dwh
Messages: 24
Registered: April 2008
Location: Pune
Junior Member
Michel Cadot wrote on Fri, 27 June 2008 01:03
Most of the time, "A minus B union all B minus A"

Regards
Michel



Can you please elaborate a bit more Michel.
Re: How can i find if two Tables are Equal to each other? [message #330009 is a reply to message #330007] Fri, 27 June 2008 05:24 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Just add "select * from " at the correct place (assuming tables are A and B) and you have the query.

Regards
Michel
Re: How can i find if two Tables are Equal to each other? [message #330021 is a reply to message #330007] Fri, 27 June 2008 06:17 Go to previous message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Quote:
Just add "select * from " at the correct place (assuming tables are A and B) and you have the query.

Regards
Michel


In case this does not make sense to you search for MINUS function and you will get the answer
Previous Topic: PASS A TABLE NAME AS A PARAMETER IN PL/SQL?
Next Topic: Connect By Clause - Child -> Parent (merged)
Goto Forum:
  


Current Time: Fri Dec 09 19:28:33 CST 2016

Total time taken to generate the page: 0.11948 seconds