SQL巧用逗号分隔的字符串实现类似于 where field in (a,b,c,d)的查询

declare @array nvarchar(100)
set @array='5,100,23,25,7'

select customer_id,customer_name,remarks
from customers
where ','+@array+',' like '%,'+convert(nvarchar(100),customer_id)+',%'

你可能感兴趣的:(AJAX/jQuery,.Net)