0

Possible Duplicate:
Why Oracle 10g doesn't complain about column ambiguity?

Relatively simple query:

SELECT X.a
       ,X.b
       ,X.c
       ,created_date -- exists in X, Y and Z, as you might expect
FROM X
LEFT JOIN Y
    ON Y.b = X.b
LEFT JOIN Z
    ON Z.c = X.c

We get no error regarding ambiguous join, but notice unexpected NULLs in the data for created_date - after investigating, it turns out correctly when prefix created_date with X.

Other columns, when prefixes are removed, do cause an error when creating the package.

Advised colleague to ensure table alias prefixes are always used, but why would it not warn about ambiguity when creating the package for come columns and not for others?

4

0 回答 0