---------------------------
The query above can running well in 10G, but will cause an
error on 11G, of course, I can rewrite the query, but who can tell me
why, 11G have new feature ? have any parameter to solve this problem?
Thank you.
Havel
There was an opposite bug - not generating an ORA-00918 with ansi join
and ambiguously defined columns, so that Oracle picked the columns at a
random and results were inconsistent. It was fixed and now you have to
alias all the columns using ansi join (at least it was my impression
from the note which i referenced) , so the bug you are hitting is closed
as not a bug. See Note 835701.1, Bug 7343313, Bug 6760937, Bug 5368296.
Best regards
Maxim
--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab
yes, the query work fine in 10g, but cause ora-918 in 11G.
Apart from the bug you encounter, I definitely think you should rethink
your query, if this is a real life example and if I understand its
functionality.
Shakespeare
If you prefix the select list supplier_code column with
a.supplier_code does the error go away?
I am not sure if Oracle considers an inline view to be a sub-query but
the Oracle SQL manual specifically states to always alias all sub-
query columns:
>> ver 10gR2 SQL Ch 9 'Using Subqueries' >>
If columns in a subquery have the same name as columns in the
containing statement, then you must prefix any reference to the column
of the table from the containing statement with the table name or
alias. To make your statements easier to read, always qualify the
columns in a subquery with the name or alias of the table, view, or
materialized view
<<
Also if prefixing does not eliminate the issue, try using a normal pre-
ANSI-92 join syntax. That should get you around the issue.
HTH -- Mark D Powell --