Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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. –  FreshPhilOfSO Nov 17 '13 at 23:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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