v:='00101,00103'因为在过程中不能用IN,所以原来的
select a,b,c from talbe where a in (v)用instr代替,select a,b,c from talbe
where instr(v,a) > 0a字段的值有001,00101,00103,00104,00105,等等.其中有一条为001.
按上述含有instr的语句查询出来的结果就有三条记录,把001也查出来了,这当然不是我想要的结果.请帮帮我,谢谢!!

解决方案 »

  1.   

    select a,b,c from talbe
    where instr(a,'00101') > 0
       or insrt(a,'00103')> 0
      

  2.   

    select a,b,c from talbe
    where instr(','||v||',',','||a||',') > 0行吗?没测试
      

  3.   

    这样允许吗?
    先将变量
    v:='00101,00103' 变成v:=',101,00103,'语句变成
    select a,b,c from talbe
    where instr(v,','||a||',') > 0
      

  4.   

    就用这个就可以
    select a,b,c from talbe
    where instr(','||v||',', ','||a||',') > 0
      

  5.   

    select a,b,c from talbe
    where instr(  ','||v  ,  ','||a  ) > 0
      

  6.   

    加上‘,’去判断。
    如:
    在v和a最后加上一个‘,’
    00101, 00103,
    然后
    用a中的数据(带上‘,’)
    instr(v,a)就可以拉!