case when 条件1 then 值1 when 条件2 then 值2 else 值3 end
这个相当于 java 里面的 if....elseif....elseif.....else
select last_name, salary, case when salary >=10000 then '高级'
when salary >= 5000 then '中级'
when salary >= 3000 then '低级'
else '草根' end "details",
department_id
from employees;
case 表达式 when key1 then 值1 when key2 then 值2 else 值3 end
这个相当于java 里面的 switch 值 case X case Y default Z
select employee_id, salary, case department_id when 10 then salary * 1.1
when 20 then salary * 1.2
when 30 then salary * 1.3
else salary * 1.4 end "details"
from employees;