Hello Im trying to import this query to toad but I got an error
Error:
"[Microsoft][ODBC Excel Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'."
SQL QUERY:
WITH DepartmentSalaries AS (
SELECT
department_id,
AVG(salary) AS avg_salary
FROM
employees
GROUP BY
department_id
)
SELECT
e.employee_id,
e.employee_name,
ds.avg_salary
FROM
employees e
JOIN
DepartmentSalaries ds
ON
e.department_id = ds.department_id;