select * from 表B where co11 in (select A_coll from 表A) or co12 in (select A_coll from 表A)

解决方案 »

  1.   

    这样:
    create table t1(a varchar(10))
    create table t2(b varchar)
    insert into t1 select 'a|b|c|d'
    insert into t2 select 'a'
    insert into t2 select 'c'
    insert into t2 select 'd'
    insert into t2 select 'e'
    select b from t2,t1 where charindex(b,a)>0
    drop table t1
    drop table t2 
    -----------测试--------------
    a
    c
    d
      

  2.   

    select * from 表A where A_co11 in (select co11 from 表B) or A_co11 in (select co12 from 表B)
      

  3.   

    A_Col1 中的字段"a|b|c|d"不是固定的,但表B中的列可以是固定的,但行是不定的。