我有两张表格,行数据都在一万行以上,对这两长表进行表间连接,得不到数据,是怎么一回事?
待高手解答……

解决方案 »

  1.   

    select a.aid,a.aname from testuser.tablea a ,testuser.tableb b 
    where a.aid=b.bid and b.bnd='2009'
      

  2.   

    select * from testuser.tablea 
    where aid in (select bid from testuser.tableb where bnd='2009')
    还有就是这个啊。数据多的时候也不能用。
    初学oracle,就让这么个问题给难住了。惭愧啊惭愧……
      

  3.   

    把where条件一条一条的去掉  就知道  哪个是关键了
      

  4.   

    那就是没有符合条件的记录了
    如果你确信有符合条件的记录而没有显示正确的结果
    那应该就是表数据或者sql语句的问题了
    在这样小的数据量上,oracle本身出错的可能性基本不存在
      

  5.   

    试试
    select * from testuser.tablea 
    where aid in (select bid from testuser.tableb where trim(bnd)='2009')如果还不行,请贴出你的表结构
      

  6.   

    终于可以了。谢谢您的提示,用trim()
    select a.aid,a.aname,c.cnd from testuser.tablea a 
     join  testuser.tablec  c  on trim(a.aid)=trim(c.aid)
    这样子的话,可以显示数据了。原因是左右不匹配。谢谢,非常感觉。也谢谢楼上各位热心的朋友。