在Oracle中,关于语法-如何将(+)语法转换为现代的常规JOIN? [英] In Oracle, in regards to syntax - how do I convert the (+) syntax to modern conventional JOIN?
本文介绍了在Oracle中,关于语法-如何将(+)语法转换为现代的常规JOIN?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一个像这样的FROM子句:
Suppose I have a FROM clause like so :
FROM
apps.po_requisition_lines_all prl,
apps.po_requisition_headers_all prha,
po.po_req_distributions_all prda,
po.po_distributions_all pda,
po.po_headers_all pha
where 1=1
and prl.requisition_header_id= prha.requisition_header_id
and prl.requisition_line_id= prda.requisition_line_id
and prda.distribution_id= pda.req_distribution_id(+)
and pha.po_header_id(+)=pda.po_header_id
然后,如果我们要使用普通的JOIN语法,如何转换这种类型的OUTER JOIN?谢谢!
Then how does this type of OUTER JOIN get converted if we want to use normal JOIN syntax ? thanks !
推荐答案
没有看到该架构,我觉得很困难,但这应该为您提供了正确的方向:
Without seeing the schema, I find it difficult but this should set you in the right direction:
FROM apps.po_requisition_lines_all prl
INNER JOIN apps.po_requisition_headers_all prha ON prl.requisition_header_id = prha.requisition_header_id
INNER JOIN po.po_req_distributions_all prda ON prda.requisition_line_id = prl.requisition_line_id
LEFT JOIN po.po_distributions_all pda ON prda.distribution_id = pda.req_distribution_id
-- I note from the example provided that this is a right join
-- Without seeing the schema, it looks to me as though it should be left
-- As I say say, without seeing the schema, I probably shouldn't pass comment
RIGHT JOIN po.po_headers_all pha ON pha.po_header_id = pda.po_header_id;
对于INNER JOIN
,您只能说JOIN
,尽管我认为明确地说INNER
有助于提高可读性.我还注意到提供的示例具有WHERE 1=1
,这是多余的.
For an INNER JOIN
you can just say JOIN
although I think that explicitly saying INNER
aids readability. I also note the example provided has WHERE 1=1
which is redundant.
这篇关于在Oracle中,关于语法-如何将(+)语法转换为现代的常规JOIN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文