on 2012 Dec 06 5:22 AM
Simple Query
select * from c_master join e_master;
[No Problem]
BUT
select * from c_master c join e_master e;
[Could not execute statement. There is more than one way to join 'c' to 'e' SQLCODE=-147, ODBC 3 State="42000"]
Why is this?
Request clarification before answering.
This doc page might give a clue:
As you are using JOIN without an explicit ON condition and without a further JOIN specifier, you are using a KEY JOIN. And this is somewhat dependent on the role name of the FK relationship, which seems to depend on the name of the table. I could imagine (but that's a guess) that using an ALIAS somewhat "disturbs" that search here - but that would only hold if there are more than one FKs between c_master and e_master, and one of them is named after the parent table - that would be the one used when not using an ALIAS).
FWIW, I regurlary use KEY JOINs with tables with ALIASed names and have never run into that issue. IMHO, KEY JOINs only fail (as expected) when there are more than 2 FK relationships (and in our cases, if so, they are both named differently than the parent table itself).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
50 | |
10 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.