Query Fails With ORA-00918 After Upgrade to 11g (Doc ID 835701.1)

Last updated on DECEMBER 06, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.5 to 11.2.0.2 [Release 10.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 01-Aug-2016***


Symptoms

Query that worked fine in 10.2 is now failing with ORA-918 in 11g

For example:

SELECT PROJECT_ID,
       PROJ_VERSION_NO,
       NAME ,
       DESCRIPTION ,
       LAST_CHANGED_DATE
FROM   leeh.PW2_PROJECT
JOIN
  (SELECT PROJECT_ID AS MAX_ID,
          MAX(PROJ_VERSION_NO) AS MAX_VERSION
   FROM leeh.PW2_PROJECT
   GROUP BY PROJECT_ID
  ) T
ON  PROJECT_ID = MAX_ID
AND PROJ_VERSION_NO = MAX_VERSION
WHERE PROJ_VERSION_NO > 0;

ORA-00918: column ambiguously defined

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms