Oracle外连接语法 [英] Oracle outer join syntax
本文介绍了Oracle外连接语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个如下查询:
select *
from find fsc,
let lf,
cust cus,
STRIKE ist
WHERE fsc.id = lf.id
AND ist.ID_old = fsc.ID_old
AND lf.cust_id = cus.cust_id(+)
我知道(+)是联接的旧语法,但是我不确定它对该查询的实际作用.有人可以解释一下,并使用更现代的连接语法在where语句中显示不带(+)的查询吗?
I know (+) is old syntax for a join, but I am not sure what it is actually doing to this query. Could someone explain this and show this query without the (+) in the where statement, using more modern join syntax?
推荐答案
我相信您想要这样做:
select *
from find fsc join
let lf
on fsc.id = lf.id join
STRIKE ist
on ist.ID_old = fsc.ID_old left join
cust cus
on lf.cust_id = cus.cust_id;
说实话,外部联接可能不是必需的.为什么lf
的cust_id
无效?唯一合理的可能性是值是否为NULL
.
To be honest, the outer join is probably not necessary. Why would lf
have a cust_id
that is not valid? The only reasonable possibility is if the value is NULL
.
这篇关于Oracle外连接语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文