最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
sql中字符串分割函数
时间:2022-06-29 08:22:48 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
SET ANSI_NULLS ON /*by kudychen 2011-9-28 */ while (@Index>0) if (@RemoveEmptyEntries=0) or (@RemoveEmptyEntries=1 and @Entry<>'') set @Input = substring(@Input, @Index+datalength(@Separator)/2, len(@Input)) set @Entry=ltrim(rtrim(@Input)) end |
Test Code:
代码如下 | 复制代码 |
declare @str1 varchar(max), @str2 varchar(max), @str3 varchar(max) set @str1 = '1,2,3' select [Value] from [dbo].[SplitString](@str1, ',', 1) |
Code:
代码如下 | 复制代码 |
SET ANSI_NULLS ON /*by kudychen 2011-9-28 */ while (@Index>0) if (@RemoveEmptyEntries=0) or (@RemoveEmptyEntries=1 and @Entry<>'') set @Input = substring(@Input, @Index+datalength(@Separator)/2, len(@Input)) set @Entry=ltrim(rtrim(@Input)) end |
Test Code:
代码如下 | 复制代码 |
declare @str1 varchar(max), @str2 varchar(max), @str3 varchar(max) set @str1 = '1,2,3' select [Value] from [dbo].[SplitString](@str1, ',', 1) |
相关文章
- 碧蓝航线大型作战装备研发优先级攻略 04-30
- 我的勇者游侠怎么搭配最强 04-30
- 仙剑世界照影迷妄镜任务流程完整解析 04-30
- CF手游王者风神保底价格攻略 04-30
- 明日之后前期装备推荐依据分享 04-30
- 明日之后菊花瓣食谱怎样 04-30