KNOWLEDGE BASE

Error "ORA-00918: column ambiguously defined" Using Custom SQL


Published: 06 Feb 2014
Last Modified Date: 05 Dec 2017

Issue

When connecting to an Oracle database with custom SQL, the following error might occur:

ORA-00918: column ambiguously defined  

Environment

  • Tableau Desktop
  • Oracle

Resolution

Alias any duplicated column names to unique column names.
For example, in your custom SQL statement, rather than
select usertest1.col1, usertest2.col1, from usertest1, usertest2
Write: 
select usertest1.col1 as 1_col1, usertest2.col1 as 2_col1, from usertest1, usertest2
 

Cause

The same column name exists in at least two separate tables being joined. The custom SQL does not contain enough specificity to determine which of these columns to use. 
Did this article resolve the issue?