I am working on Oracle database 11g, and facing an issue while trying to execute the following query:
SELECT d.department_name, e.manager_id, l.location_id, sum(e.salary) FROM departments d, employees e, locations l WHERE d.department_id = e.department_id AND e.manager_id = d.manager_id (+) AND l.location_id = d.location_id (+) GROUP BY d.department_name, e.manager_id, l.location_id;
the query is not executed and returned the following error :
ERROR at line 4: ORA-01417: a table may be outer joined to at most one other table
Hopefully somebody help me understanding what is going on, and why the database refuses to execute the query.
thanks in advance.
Before Oracle database release 12c, the error ORA-01417 is raised when you have more than one table on the left-hand side of an outer join. To overcome this limit, we can convert the join to an ANSI syntax, e.g.:
From the 12c version, Oracle has supported having multiple tables on the left-hand side of the join.