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-07-30 10:23:55 发布

109

被折叠的 条评论
为什么被折叠?



