Skip to content Skip to sidebar Skip to footer

Performance Issue When Updating Table From Another Table

I'm trying to update old customers data with new data, so basically I'm updating firstname and lastname of old_customer_source table with firstname and lastname of new_customer_sou

Solution 1:

Try to use merge.

merge into old_customer_source t1
using (select t2.custid, t2.firstname, t2.lastname
         from  new_customer_source t2
      ) t2
 on (t1.custid = t2.custid)
when matched then
update set t1.firstname = t2.firstname, 
           t1.lastname = t2.lastname
;

Post a Comment for "Performance Issue When Updating Table From Another Table"