Home » SQL & PL/SQL » SQL & PL/SQL » diff b/n Join& merge
diff b/n Join& merge [message #212885] Mon, 08 January 2007 14:12 Go to next message
Messages: 14
Registered: August 2006
Location: Newjersey
Junior Member

Can anyone explin in detail with an example,What is the difference between joining and merging?

Re: diff b/n Join& merge [message #212892 is a reply to message #212885] Mon, 08 January 2007 14:59 Go to previous message
Messages: 32
Registered: October 2006
Location: Boston
Presumably you already know what a join is, so will not explain it.
Merge is the the command for performing an "upsert".
When you issue the MERGE command Oracle will check if the matching record (based on the conditions you specify) already exists. If it does it will either update or delete the existing record. If not it will insert the new record.

BTW if you look at the explain plan for a merge statement you will see that under the hood among other things the optimizer perfroms a join.

[Updated on: Mon, 08 January 2007 15:01]

Report message to a moderator

Previous Topic: SQL QUERY to eliminate dups. and only vendors from current year
Next Topic: find friday the 13th's!
Goto Forum:

Current Time: Thu Jun 22 22:41:16 CDT 2017

Total time taken to generate the page: 0.12641 seconds