I'm practicing functions on Oracle SQL, and now I'm trying to code a group function to print on console AVG salary group by departments id, and I want to add the column department name from another table. I think my syntax is correct but anyway I received an Oracle Error.
SELECT e.department_id, d.department_name, e.AVG(salary)
FROM employees e
JOIN departments d
ON (e.department_id = d.department_id)
GROUP BY department_id, department_name;
ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
*Cause:
*Action: Error en la línea: 5, columna: 10