Home » SQL & PL/SQL » SQL & PL/SQL » Comparing two tables DATA (Oracle 9i)
Comparing two tables DATA [message #447584] Tue, 16 March 2010 04:48 Go to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Gurus,

I want to do a comparision for the missing rows between two diffrent tables

TBL1 and TBL2 both with the same structure but with diffrent data some data is identical. though my data is huge i wanted to make sure the technique i am using, Please guide me for the simplest one.

Javed
Re: Comparing two tables DATA [message #447586 is a reply to message #447584] Tue, 16 March 2010 04:50 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

The "simplest" one would be using the MINUS operator.
Re: Comparing two tables DATA [message #447587 is a reply to message #447586] Tue, 16 March 2010 04:53 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Thanks.. Anything else performance wise..?
Re: Comparing two tables DATA [message #447588 is a reply to message #447587] Tue, 16 March 2010 05:00 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You've got to look at all the data in both tables - what sort of performance were you hoping for?
Re: Comparing two tables DATA [message #447590 is a reply to message #447588] Tue, 16 March 2010 05:03 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Only Speeding Up the process... does "NOT EXIST" work for this scenario?
Re: Comparing two tables DATA [message #447591 is a reply to message #447590] Tue, 16 March 2010 05:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Not better than MINUS.

Regards
Michel
Re: Comparing two tables DATA [message #447592 is a reply to message #447591] Tue, 16 March 2010 05:14 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Since you want to compare the entire row"s" between the 2 tables, you are probably better off using MINUS.
Re: Comparing two tables DATA [message #447601 is a reply to message #447592] Tue, 16 March 2010 05:52 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Got it...
Thanks All.
Re: Comparing two tables DATA [message #447772 is a reply to message #447584] Wed, 17 March 2010 15:46 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
For what is was worth, I was told at some oracle conference years ago, that the guy who wrote the MINUS logic was a genius and did a wicked awesome job of it, making it super fast compared to other techniques.

Who knows if this is true of if it still applys given all the advances in oracle over the years but it sounded good to me and took away my concerns about using it.

Kevin
Previous Topic: indexes for query performance
Next Topic: Database Trigger
Goto Forum:
  


Current Time: Thu Dec 08 01:53:20 CST 2016

Total time taken to generate the page: 0.10823 seconds