Need to edge out the competition for your dream job? Train for certifications today.
MERGE INTO tableA A
USING (SELECT employee_id, salary, department_id
WHERE department_id = 80) S
ON (A.employee_id = S.employee_id)
WHEN MATCHED THEN UPDATE SET A.bonus = A.bonus + S.salary*.01
WHEN NOT MATCHED THEN INSERT (A.employee_id, A.bonus)
VALUES (S.employee_id, S.salary*0.1)
WHERE (S.salary <= 8000)
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.