SQLServer 实现字符串Split
时间:2021-08-30 14:55:21
收藏:0
阅读:63
# 字符串Split
declare @sql1 varchar(1000)
set @sql1 = ‘select field=‘‘‘ + replace(‘1,23,456,789‘,‘,‘,‘‘‘ union all select ‘‘‘)+‘‘‘‘
exec(@p_sql)
# 结果集用作条件
declare @sql2 varchar(1000)
set @sql2 = ‘select field1,field2,field3 from table_name where field1 in (‘+@p_sql+‘)‘
exec(@p_sql)
原文:https://www.cnblogs.com/Jacob-yang/p/15193576.html
评论(0)