create table target(id number, name varchar2(10));
insert into target values (1, 'Vinay');
create table source(id number, name varchar2(10));
insert into source values (1, 'sql');
insert into source values (1, 'oracle');
merge into target t
using (select * from source) s
on (t.id = s.id)
when matched then update set t.name = s.name;
I am getting ora-30296 error but I need to update rows of the target table even if that id is duplicated in the source table. Is there any other way where I can do this instead of merging? If the source table contains id as 1 with two different values then in the target table latest records should be present. I am wondering how to achieve this?