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)+',%'
SQL巧用逗号分隔的字符串实现类似于 where field in (a,b,c,d)的查询
最新推荐文章于 2022-05-31 11:25:29 发布