日期:2014-05-17 浏览次数:20730 次
with table1(id,iid) as( select 1,'A,B' from dual union all select 2,'B,C,D' from dual union all select 3,'A,D' from dual ), table2(id,mc) as( select 'A','this is a' from dual union all select 'B','this is b' from dual union all select 'C','this is c' from dual ) select * from table2 where exists( select 1 from table1 where table1.id=1--此处传你的id and instr('%,'||iid||',%',','||table2.id||',')>0); /* I MC - --------- A this is a B this is b */