create table tt (a varchar(20),b varchar(20))
insert into tt (a,b)
select 'a01','1,2,3,4,5,6'
union all
select 'a02','1,2,3'
union all
select 'a03','4,5,6' declare @b varchar(10)
set @b='1,4,5'
/*----由@b的值得到的结果
a b
--------------------------------
a01 1,2,3,4,5,6
a03 4,5,6
*/drop table tt
insert into tt (a,b)
select 'a01','1,2,3,4,5,6'
union all
select 'a02','1,2,3'
union all
select 'a03','4,5,6' declare @b varchar(10)
set @b='1,4,5'
/*----由@b的值得到的结果
a b
--------------------------------
a01 1,2,3,4,5,6
a03 4,5,6
*/drop table tt
select a,b from tt where (b like '%4%') or (b like '%5%')问题 b like '%4%' 是不是 b的值为 '44'或 '444'的也筛选出来呢!当然!可我要得结果是全匹配的值