使用(+;)的Oracle SQL连接
我想要的是使用(+)将此查询转换为旧方法:使用(+;)的Oracle SQL连接,oracle,oracle11g,Oracle,Oracle11g,我想要的是使用(+)将此查询转换为旧方法: select * from tbla a left join tblb b on b.col = a.col left join tblc c on c.col = a.col 我试过: select * from tbla a, tblb b, tblc c where a.col(+) = b.col and a.col(+) = c.col; 但是发生了一个错误: ORA-01417:一个表最多可以与另一个表进行外部联接我认为您在错误的表
select * from tbla a
left join tblb b
on b.col = a.col
left join tblc c
on c.col = a.col
我试过:
select * from tbla a, tblb b, tblc c
where a.col(+) = b.col and a.col(+) = c.col;
但是发生了一个错误:
ORA-01417:一个表最多可以与另一个表进行外部联接我认为您在错误的表上使用了+,请尝试:
select *
from tbla a, tblb b, tblc c
where a.col = b.col(+) and b.col = c.col(+);
我认为你应该这样做:
select *
from (select *
from tbla a
, tblb b
where a.col = b.col(+)
) a1
, tblc c
where c.col(+) = a1.col;
这是对这种旧式语法的限制。但我想说的是:为什么要进行这样的向后转换?甚至Oracle也建议停止使用古老的、专有的
(+)
运算符,并建议移动到显式的左联接