Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> help with my merge statement
I have a table
A (id1, id2, id3), B(id1,id2,id3)
What I wnat is, if (id1 and id2) both matches, then update id3, if not matches, then insert
merge into A using B
on (A.id1 = b.id1,a.id2 = b.id2) when matched then update set a.id3= b.id3 when not matched then insert (a.id1, a.id2, a.id3) values (b.id1, b.id2, b.id3)
How can I achive this?
Thanks for your help. Received on Mon Jul 10 2006 - 09:08:08 CDT