可能重复:
Why Oracle 10g doesn't complain about column ambiguity?
相对简单的查询:
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
我们没有收到关于歧义加入的错误,但是在NULL
的数据中发现了意外的created_date
- 在调查之后,当created_date
前缀为X
时,结果正确
删除前缀时,其他列在创建包时会导致错误。
建议同事确保始终使用表别名前缀,但为什么在为列而不是为其他列创建包时不会出现歧义警告?