|
发表于 2021-3-5 13:00:01
|
显示全部楼层
declare @CardNumber varchar(50)
DECLARE @sql NVARCHAR(2000)
set @CardNumber='1.2.3.4'
set @CardNumber = '''' + replace(@CardNumber, '.', ''',''') + ''''
select @CardNumber
SET @sql = 'select 1 where '''+'1'+''' in (' + @CardNumber + ')'
exec (@sql)
----->这样都可以查到阿 |
|