我有一张桌子,
我的预期输出是(10,20,30是deptno):
所以我这样尝试:
select job,case
when deptno=10 then sum(sal) else null
end dept_10_data,case
when deptno=20 then sum(sal) else null
end dept_20_data,case
when deptno=30 then sum(sal) else null
end dept_30_data
from ot.employee group by job;
但是我收到以下错误消息:
ORA-00979: not a GROUP BY expression
如何获得此输出?