一下语句不能得到结果,不知道出错在哪里?
原来数据集是:
Id Name Jobcode Salary
--- - ----- ------- ------
001 Albert PT1 50000
002 Brenda PT1 70000
003 Carl PT1 60000
004 Donna PT2 80000
005 Edward PT2 90000
006 Flora PT3 100000
proc sql ;
select Jobcode, Salary,
(select avg(Salary)
from WORK.PILOTS
group by Jobcode) as Avg
from WORK.PILOTS
order by Id;
quit;