从 ANSI 到 Oracle 连接语法的转换
我想将以下查询:转换
SELECT
request.requestId
FROM
request
LEFT OUTER JOIN incident ON incident.requestId = request.requestId
LEFT OUTER JOIN changeRequest ON changeRequest.requestId = request.requestId
为等效的 Oracle join 语法。我的第一次尝试:
SELECT
request.requestId
FROM
request,
incident,
changeRequest
WHERE
incident.requestId = request.requestId(+)
AND changeRequest.requestId = request.requestId(+)
由于“ORA-01417:一个表最多可以外部连接到另一个表”错误而不起作用。
我意识到 Oracle 建议使用 ANSI 方法,但是我“遭受”以下 Oracle bug 的困扰:
http://awads.net/wp/2007/06/14/when-ansi-sql-join-syntax-does-not- work-in-oracle/
预先感谢, 本
I would like to convert the following query:
SELECT
request.requestId
FROM
request
LEFT OUTER JOIN incident ON incident.requestId = request.requestId
LEFT OUTER JOIN changeRequest ON changeRequest.requestId = request.requestId
into it's Oracle join syntax equivalent. My first attempt:
SELECT
request.requestId
FROM
request,
incident,
changeRequest
WHERE
incident.requestId = request.requestId(+)
AND changeRequest.requestId = request.requestId(+)
does not work because of the "ORA-01417: a table may be outer joined to at most one other table" error.
I realise that Oracle recommend using the ANSI approach, however I am "suffering" from the following Oracle bug:
http://awads.net/wp/2007/06/14/when-ansi-sql-join-syntax-does-not-work-in-oracle/
Thanks in advance,
Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的 (+) 写错了,应该是:
顺便说一句,我假设你意识到这是旧的 Oracle 语法? Oracle 长期以来一直支持 ANSI 连接。
You have the (+) on the wrong side, it should be:
BTW I assume you realse this is the old Oracle syntax? Oracle has supported ANSI joins for a long time now.
仅供参考,根据我们的痛苦经验,Oracle(版本 10,11 和 12)中复杂的 ANSI 内部联接有时会导致 ORA-00600 错误(核心转储)。我们被迫将许多 ANSI 连接回溯到 Oracle 连接以避免这种情况。
FYI, in our painful experience, complex ANSI inner joins in Oracle (versions 10,11, and 12) occasionally cause ORA-00600 errors (core dumps). We have been forced to backtrack many of our ANSI joins back to Oracle joins to avoid this.