User Tools

Site Tools


This is an old revision of the document!

merge into accountants a
using (
SELECT employees.employee_id, first_name, last_name, hire_date, salary, job_title
  FROM employees, jobs
  WHERE ((jobs.job_id = employees.job_id) 
  AND (jobs.job_title LIKE 'Account%')     )
) e
on (a.employee_id = e.employee_id)
when matched then update set a.salary = e.salary
when not matched then insert 
(first_name, last_name, employee_id, hire_date, salary, job_title)
(e.first_name, e.last_name, e.employee_id, e.hire_date, e.salary, e.job_title)
kurs/merge_accountants.1274174146.txt.gz · Last modified: 2014/09/10 21:22 (external edit)