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)的查询
最新推荐文章于 2024-01-30 18:00:43 发布