Select * from tttt Where
(CHARINDEX(',', a) >0 and ('0001'=Left(a,CHARINDEX(',', a)-1) Or a like '%,0001,%'
OR a like '%,0001' OR a = '0001' )) Or a = '0001'
(CHARINDEX(',', a) >0 and ('0001'=Left(a,CHARINDEX(',', a)-1) Or a like '%,0001,%'
OR a like '%,0001' OR a = '0001' )) Or a = '0001'