我想转换以下查询:
SELECT request.requestId FROM request LEFT OUTER JOIN incident ON incident.requestId = request.requestId LEFT OUTER JOIN changeRequest ON changeRequest.requestId = request.requestId
它与Oracle连接语法等效。我的第一次尝试:
SELECT request.requestId FROM request, incident, changeRequest WHERE incident.requestId = request.requestId(+) AND changeRequest.requestId = request.requestId(+)
由于“ ORA-01417:一个表最多可以外部连接到另一个表”错误而无法正常工作。
我意识到Oracle建议使用ANSI方法,但是我受到以下Oracle错误的“折磨”:
http://awads.net/wp/2007/06/14/when-ansi-sql-join-syntax-does-not-work-in- oracle/
预先感谢,本
您在错误的一面有(+),应该是:
SELECT request.requestId FROM request, incident, changeRequest WHERE incident.requestId (+)= request.requestId AND changeRequest.requestId (+)= request.requestId
顺便说一句,我假设您意识到这是 旧的 Oracle语法吗?Oracle长期以来一直支持ANSI联接。