select a.contractid,a.seqno, b.chsdesc
from TB_PHCONTRACTDETAIL a, codetable b
where a.paymode = b.codevalue(+) and b.codeid = 2017
and a.contractid is not null;
select a.contractid,a.seqno, b.chsdesc
from TB_PHCONTRACTDETAIL a left outer join
codetable b ON a.paymode = b.codevalue and b.codeid = 2017
where a.contractid is not null;
在9i里面,上面没有得到左关联的效果,而下面的语句执行正确。请高手解释一下oracle的SQL语句的变迁?现在的10g怎么样了?
from TB_PHCONTRACTDETAIL a, codetable b
where a.paymode = b.codevalue(+) and b.codeid = 2017
and a.contractid is not null;
select a.contractid,a.seqno, b.chsdesc
from TB_PHCONTRACTDETAIL a left outer join
codetable b ON a.paymode = b.codevalue and b.codeid = 2017
where a.contractid is not null;
在9i里面,上面没有得到左关联的效果,而下面的语句执行正确。请高手解释一下oracle的SQL语句的变迁?现在的10g怎么样了?
from TB_PHCONTRACTDETAIL a, codetable b
where a.paymode(+) = b.codevalue and b.codeid = 2017
and a.contractid is not null;
试试是你要的结果吗?
select a.contractid,a.seqno, b.chsdesc
from TB_PHCONTRACTDETAIL a,
(select * from codetable where codeid=2017) b
where a.paymode = b.codevalue(+)
and a.contractid is not null;