how to resolve error ORA-00979: not a GROUP BY expression
DECLARE
CURSOR TAMPILDATA IS
select to_char(hire_date,'YYYY') as thn, count(to_char(hire_date,'YYYY'))as jumlah, job_title
from employees a,jobs b
where a.job_id=b.job_id
group by to_char(hire_date,'YYYY') order by to_char(hire_date,'YYYY');
BEGIN
FOR VARIABLE_X IN TAMPILDATA LOOP
DBMS_OUTPUT.PUT_LINE (VARIABLE_X.thn||' : ' ||VARIABLE_X.JUMLAH||' Orang');
END LOOP;
END;