I am trying to write a query to get information about the employees who hired first in each department. I am writing the query below and I get
"ORA-00904: "RN": invalid identifier 00904. 00000 - "%s: invalid identifier"
Query:
select employee_id, department_id, first_name, last_name, hire_date,
ROW_NUMBER () over (partition by department_id order by hire_date) as rn
from employees
where rn =1;
Can you please explain to me what is wrong with the "rn" identifier?