行转列后关联就行了,说说你的具体需求吧
table1
column1
1
2
3
table2
column2
3
5
7
select table1.column1  from table1,table2 where table1.column1 = table2.column1

解决方案 »

  1.   

    with a as
         ( select '(1,2,3)' as c from dual ),
         b as
         ( select '(3,5,7)' as c from dual ),
         a1 as
         ( select ','||substr(c,2,length(c) - 2)||',' as c from a ),
         b1 as
         ( select ','||substr(c,2,length(c) - 2)||',' as c from b ),
         a2 as
         ( select substr( c,instr(c,',',1,level) + 1,
                          instr(c,',',1,level + 1) - instr(c,',',1,level) - 1 ) as c from a1 
          connect by level < length(c) - length(replace(c,',',''))),
         b2 as
         ( select substr( c,instr(c,',',1,level) + 1,
                          instr(c,',',1,level + 1) - instr(c,',',1,level) - 1 ) as c from b1 
          connect by level < length(c) - length(replace(c,',','')))
    select a2.c from a2,b2 where a2.c = b2.c
      

  2.   

    取交集即可。 INTERSECT,两个查询结果集的交集。