create function isin(@s varchar(100),@c varchar(100)) 
returns bit 
as  
  begin  
    declare @a table(a int) 
    declare @t varchar(20) 
    while len(@s)>0 
       begin  
         set @t=substring(@s,1,charindex(',',@s)-1) 
         set @s=stuff(@s,1,charindex(',',@s),'') 
         insert into @a select cast(@t as int)   --可以直接判断然后用break退出
       end 
    declare @r bit 
    if exists(select 1 from @a where ','+@c+','  not like '%,'+cast(a as varchar(10))+',%' ) 
       set @r=0  
    else  
       set @r=1 
    return(@r) 
end godecare @ss_fbr varchar(100)
set @ss_fbr='12,15,18'
select * from yourtable where dbo.isin(fbr,@ss_fbr)=1