merge into accountants a using (select first_name, last_name, salary from employees where last_name = 'Abel') e on (a.last_name = e.last_name and a.first_name = e.first_name) when matched then update set a.salary = e.salary when not matched then insert values (e.first_name, e.last_name, e.salary);