declare @t table([str] varchar(10)) insert into @t select '1,2,3' union all select '2,3' union all select '3,4' union all select '4,5' union all select '5,4' union all select '3,4,5'select * from @t where [str] like '%1%' select * from @t where [str] like '%4%'
select * from TB where charindex(',1,',','+A+',')>0select * from TB where (','+A+',') like '%,1,%'
select * from tb where a like '%4,%' or a like '%,4'
select * from tb where A like '%4%'
select * from tb where A like '%4%'
select * from Tablename where A like '%4%'
select A from tb where charindex('1',A)<>0 select count(A) from tb where charindex('4',A)<>0
insert into @t select '1,2,3'
union all select '2,3'
union all select '3,4'
union all select '4,5'
union all select '5,4'
union all select '3,4,5'select * from @t where [str] like '%1%'
select * from @t where [str] like '%4%'
select count(A) from tb where charindex('4',A)<>0