这样: 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
select * from 表A where A_co11 in (select co11 from 表B) or A_co11 in (select co12 from 表B)
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