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

解决方案 »

  1.   

    select * from tt where (b like '%4%') or (b like '%5%')
      

  2.   

    http://community.csdn.net/Expert/topic/3769/3769900.xml?temp=.738949
      

  3.   

    select a,b from tt where (b like '%4%') or (b like '%5%')
      

  4.   

    http://community.csdn.net/Expert/topic/3769/3769900.xml?temp=.738949
      

  5.   

    支持 jialiang(≈≈逆水行舟≈≈)
      

  6.   

    select a,b from tt where (b like '%4%') or (b like '%5%')
      

  7.   

    可以用一下的
    select a,b from tt where (b like '%4%') or (b like '%5%')问题 b like '%4%' 是不是 b的值为 '44'或 '444'的也筛选出来呢!当然!可我要得结果是全匹配的值