|
--查询部门号为10,20, 30 的员工信息, 若部门号为
--10 则打印其工资的1.1 倍,
--20 号部门, 则打印其工资的1.2 倍,
--30 号部门打印其工资的1.3 倍数
select last_name,department_id,case department_id when 10 then salary * 1.1
when 20 then salary * 1.2
else salary * 1.3 end new_salary
from employees
where department_id in (10,20,30)
--上面的加显示其他的人的工资
select last_name,department_id,case department_id when 10 then salary * 1.1
when 20 then salary * 1.2
when 30 then salary * 1.3
else salary end new_salary
from employees
|
|
|