I used the HR employee schema in Oracle Express and I wanted to select employees that were hired on a particular year.
SELECT hire_date,
COUNT(*)
FROM employees empl
GROUP BY SUBSTR(hire_date, -4)
ORDER BY empl.hire_date;
The hire_date column has this format "1/1/2011" so I'd like to group them by extracting the last four char.
Problem is, I am encountering below error
ORA-00979: not a GROUP BY expression
00979. 00000 - "not a GROUP BY expression"
*Cause:
*Action:
Error at Line: 1 Column: 7
Is this not possible?