У меня есть таблица как:
Мой ожидаемый результат (10,20,30 - дептно):
Итак, я попытался так:
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
Как я могу получитьэтот вывод?