当前位置: 代码迷 >> Oracle开发 >> 关于外联的有关问题
  详细解决方案

关于外联的有关问题

热度:27   发布时间:2016-04-24 07:39:47.0
关于外联的问题
从有两个表a,b中取值
用a.id   =   b.id(+)的方法进行外联
同时,如果b中没有符合条件的数据的时候,取消外联,直接返回空的结果。
我现在用的方法是,在条件后面加上
And   Not   b.id   Is   null
不知道有没有什么好方法?

------解决方案--------------------
select ...
from a,b
where a.ID=b.ID(+)不是可以实现吗?
也许我没有看明白你的意思
------解决方案--------------------
select *
from a,b
where a.id = b.id(+) And Not b.id Is null
不就等于
select *
from a,b
where a.id = b.id
了??
不明白lz想要怎样的数据?

------解决方案--------------------
select *
from a,b
where a.id = b.id(+) And Not b.id Is null

------解决方案--------------------
学习
------解决方案--------------------
这个应该用内连接,就是楼上很多兄弟说的:
select *
from a,b
where a.id = b.id
  相关解决方案