oracle 行转列
select e.job as 工作,
sum(case e.deptno
when 10 then
sal
end) as 部门10的工资,
sum(case e.deptno
when 20 then
sal
end) as 部门20的工资,
sum(case e.deptno
when 30 then
sal
end) as 部门30的工资
from emp e
group by job
order by 1;