select a.id,b.id
from (select t1.id from test1 t1 where t1.xh = '123') a,
(select t2.id from test2 t2 where t2.xh = '456') b
where a.id = b.id(+)
select a.id,b.id
from test1 a,test2 b
where a.xh = '123'
and b.xh = '456'
and a.id = b.id(+)上面两条sql第一条可以得出b表(+)a表的数据,但是第二条得出的是两个表id相同的数据。
不明白原理,请各位给上一课。
from (select t1.id from test1 t1 where t1.xh = '123') a,
(select t2.id from test2 t2 where t2.xh = '456') b
where a.id = b.id(+)
select a.id,b.id
from test1 a,test2 b
where a.xh = '123'
and b.xh = '456'
and a.id = b.id(+)上面两条sql第一条可以得出b表(+)a表的数据,但是第二条得出的是两个表id相同的数据。
不明白原理,请各位给上一课。
解决方案 »
- xmanager远程AIX系统错误,提示没有注册
- 请问如何在oracle数据库中查询xml,并且使用xml节点的值作为条件
- 有关BLOB字段导入
- 求一个简单的sql语句
- myeclipse 连接oracle 10g错误
- 坐等大神,求救
- Archive process error: ORACLE Instance oemrep - Can not allocate log, archival required
- 那位兄弟能帮写一个存储过程,高分(300)相送,谢谢了。
- 在ORACLE中如何更改用户名。
- export数据库大于4G时突然挺下来了,请问为什么?
- 重装Oracle失败的问题,谢谢
- 急问一个sql语句?!
Select * From(
select a.id aid,b.id bid
from (select t1.id from test1 t1 where t1.xh = '123') a,
(select t2.id from test2 t2 where t2.xh = '456') b
where a.id = b.id(+)
select a.id,b.id
from test1 a,test2 b
where a.xh = '123'
and a.id = b.id(+)
)
Where bid='456'