Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ORA-00918: Column ambiguity error occurs when a column listed in the SELECT clause has the same name as a column in another table to which the query refers. To resolve the issue, prefix the columns with their respective table aliases or table names where they exist in the different tables in the query. For example:

SELECT t1.id, t2.name FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id;

ORA-00904: Invalid identifier error occurs when a column or table referenced in a query does not exist. To resolve this issue, check that the column or table exists and ensure that the spelling and casing match that of the referenced column/table. Also, check that the correct schema has been set.

If your SELECT query includes a Pivot clause, ensure that the pivot column name exists and is spelled correctly. The Pivot function is used to convert rows to columns, and it requires that the specified column name should exist in the source table. If the pivot column does not exist, the ORA-00904 error will be thrown. Also, ensure that the pivot query is well-formed and that column aliases are used as appropriate.

Overall, carefully review the query syntax, database schema, and data available to resolve these errors.