Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle merge same table

 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

All, is it possible to use Oracle merge query within the same table.
Case is

1. Select if input.x and input.y combination exists in Table A
2. If a row exists update column C in Table A with inout.Z
3. If row doesnt exist insert the row

Can anyone provide me how to do this using merge ?

I wrote a procs to do this but believe a merge can handle it

Thanks
 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could anyone please help

Thanks
Atul
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34423
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to merge two different tables into one? If so, you know the syntax and are all set up to try it and find out.
 
Vamsi Mohan
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use "insert with select" query to merge the records.
 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am afraid I may need a little more help.
I have only done merge query which merges two tables.

Thankyou
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic