这个语句:
SELECT t2.code,t1.id FROM t1,t2
WHERE instr(t1.list,t2.code)>0

解决方案 »

  1.   

    select b.code, a.id from a a, b b where to_number(instr(a.list, b.code))>0
      

  2.   

    提高查询准确性:
    SELECT t2.code,t1.id FROM t1,t2
    WHERE instr(t1.list||',',t2.code)>0
    这样只不过根据上面得表的内容写的,还应该提高准确性:
    表A改为:
    A   LIST      ID 
       *1,*2,*3,   1
       *2,*4,      2
       *4,*5,      3SELECT t2.code,t1.id FROM t1,t2
    WHERE instr('*'||t1.list,t2.code)>0