Hi all,
I have a pre-existing table and my update statement is taking a really long time. So I'm switching to using Merge instead. My problem is the Merge statement below is updating the entire table. I only want it to update the remaining rows which have a null "id1" value. So I only want it to update a small subset of rows.
Trying to update table1 below:
merge into table1 x
using (select *
from table2
where model='Acura') y
on (x.account_no = y.account_no)
when matched then update set x.id1 = y.id1
where x.id1 is null; -- I only want to update rows which have a null value in field id1
commit;
Any help would be appreciated. Thanks.