1

For example (just to illustrate the problem),

CREATE TABLE test_join(ID INT NOT NULL);
--1 
SELECT ID FROM 
test_join A
INNER JOIN test_join b ON 1=1;
--2 
SELECT ID FROM 
test_join A
INNER JOIN test_join b ON 1=1
INNER JOIN test_join c ON 1=1;

The first one gives expected "ORA-00918: column ambiguously defined". The second one executes without any complaints (Oracle 10g). I wonder if it's a bug or I'm missing something obvious in name resolution rules. Oracle 11 gives error in both cases.

Thank you

2

It's realistically a bug in whatever version of 10g you're using that would appear to be fixed in whatever version of 11g you're seeing an error on both statements.

I don't have a 10g database in front of me to test this. I would wager, through, that you'd get an error in both cases if you used the old-style join syntax rather than the SQL 99 syntax. That would imply that the problem is that Oracle wasn't translating from SQL 99 syntax to old-style syntax correctly and was missing the fact that the column was ambiguously defined.

  • You're 100% correct - it's a bug. I've read many blog posts and I think there was also a long discussion on oracle-l about it. This blog post hoopercharles.wordpress.com/2010/12/26/… has links to lots of Metalink bugs regarding ANSI joins. – Philᵀᴹ Nov 17 '13 at 23:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.