CASE、DECODE
SELECT employee_id,job_id,salary,CASE job_id WHEN ‘AC_MGR’ THEN salary1.2
WHEN ‘IT_PROG’ THEN salary1.5
WHEN ‘MK_REP’ THEN salary*1.3
ELSE salary
END “Upd_salary”
DECODE
SELECT employee_id,salary,job_id,decode(job_id,‘AC_MGR’,salary1.2,‘IT_PROG’,salary1.5,‘MK_REP’,salary*1.3,salary) Upd_salary
FROM employees;
结果同上所示