本帖最后由 Octavus 于 2013-08-13 11:30:26 编辑

解决方案 »

  1.   

    select * from A a,B b where a.id=1 and b.id in (...);//这个有毛病,b_ids里面没有单引号吧。
    当时怎么没在B里面存A的主键的呀  
      

  2.   

    select  * from  A   left join b on  replace(a.id,',')=b.id
      

  3.   

    将B_IDS分割后关联B表查询需要数据
      

  4.   

    select * from A a,B b where a.id=1 and b.id in (''''||REPLACE(A.B_IDS),',',''',''')
      

  5.   

     后面少拼了一个单引号select * from A a,B b where a.id=1 and b.id in (''''||REPLACE(A.B_IDS,',',''',''')||'''')