Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Got error ORA-25154 in OUTER JOIN while no qualifier is used in USING claus

672680Mar 23 2011 — edited Mar 23 2011
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2011
Added on Mar 23 2011
2 comments
3,666 views