Hi guys,
When I run below query, I encountered the error ORA-25154: column part of USING clause cannot have qualifier.
The problem is that, as you can see, there is no qualifier used in USING clause of FULL OUTER JOIN.
So, How come? Any clue?
SELECT (CASE WHEN A.DEPTNO IS NOT NULL THEN A.DEPTNO
ELSE B.DEPTNO
END) DEPTNO,
A.ENAME, A.JOB, A.HIREDATE, A.SAL, B.DNAME, B.LOC
FROM EMP A FULL OUTER JOIN DEPT B USING (DEPTNO);
ORA-25154: column part of USING clause cannot have qualifier
25154. 00000 - "column part of USING clause cannot have qualifier"
*Cause: Columns that are used for a named-join (either a NATURAL join
or a join with a USING clause) cannot have an explicit qualifier.
*Action: Remove the qualifier.
>
PS:
the whole story is that, I did FULL OUTER JOIN between 5 tables, and I am getting the error above.
And then I try to use the same format in EMP, DEPT to see if the error persists, as turns out it does.
And I am pretty sure that the problem is in CASE WHEN statement, but fail to figure out why.
so, would really appreciate it if anyone of you could provide me some ideas or rationales behind it.
Thanks