我们的程序使用oracle的oledb驱动连接oracle数据库。调用一个存储过程,这个过程用来执行一个sql语句并返回结果:select a.id,b.orderid,c.amount,d.sales
from table1 a
left join table2 b
  on a.id=b.id
left join table3 c
  on a.id=c.id
left join table4 d
  on a.id=d.id;问题是,上面的sql语句有4个left join,于是,oracle无法查询到任何数据。
但是,如果我只用一个Left join,则查询正常:
select a.id,b.orderid
from table1 a
left join table2 b
  on a.id=b.id;请问,这是什么原因,有啥解决方法?(注:在oracle10下面,没有任何问题)

解决方案 »

  1.   

    啊?10G下面你的意思是有数据?而9i下没有?索引情况是怎么样的?有没有rownum出现损坏的情况?
      

  2.   

    先analyze table XXx validate structure
    看看有没什么异常.另外,对你的索引也作一下这个操作.
      

  3.   

    select a.id,b.orderid,c.amount,d.sales 
    from table1 a ,table2 b ,table3 c ,table4 d 
      where a.id=b.id(+)
    and  a.id=c.id(+) 
    and  a.id=d.id(+); 
      

  4.   

    你确定你的oracle9i 和 10G的各种环境和数据表都是一样的?一般来说,肯定是哪个地方你搞得不一致了