ORA-00918: column ambiguously defined

ORA-00918: column ambiguously defined

ORA-00918: column ambiguously defined

Cause:

A column name used in a join exists in more than one table and is thus referenced ambiguously.

Solution:

Prefix references to column names that exist in multiple tables with either the table name or a table alias.

Example:

SELECT COURSE_ID, COURSE_ID 
FROM ORDERS, COURSE
WHERE COURSE_ID=COURSE_ID; 

Output:

ORA-00918: column ambiguously defined

Correct

SELECT o.COURSE_ID, c.COURSE_ID, o.AMOUNT
FROM ORDERS o, COURSE c
WHERE o.COURSE_ID=c.COURSE_ID;