1、select connString_fun_temp from dual;
 2、select * from 表  a where a.id in (select connString_fun_temp from dual);
 3、select * from 表  a where a.id in (********) 通过自定义函数返回一个字符串,用第2个sql,查询不到数据,但用第3个sql能查到数据,其中第3个sql中in的条件就是
第1个sql的结果值,就一个带逗号的分割符。
 

解决方案 »

  1.   

    3中是一整个字符串,还是'str1','str2','st3',...这样的形式?
      

  2.   

    2中是‘str1,str2,str3....’这样?
      

  3.   

    select connString_fun_temp from dual; 查询出来的结果为 
    ‘1,2,3,4,56,6,4’
      

  4.   

    select * from 表 a where a.id in ('1','2','3','4','56','6','4');与select * from 表 a where a.id in ('1,2,3,4,56,6,4')的区别。
    除非你a.id有包括整个1,2,3,4,56,6,4串的,否则肯定没数据。
      

  5.   

    id如果是VARCHAR型,建议2改为(假设你函数返回字串的分隔符为 , ):
    select * from 表 a
      where INSTR(','||(select connString_fun_temp from dual)||',' , ','||a.id||',')>0;
      

  6.   

    select * from 表 a
      where INSTR(','||connString_fun_temp||',' , ','||a.id||',')>0;
    直接写函数就可以了,不用from DUAL