最新下载
热门教程
- 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) |
相关文章
- 病态金属steam上叫什么 steam游戏搜索方法分享 09-08
- 四海兄弟故乡护符怎么获取 护符获取途径说明 09-08
- 诛仙2漂流信在哪触发 漂流信中原奇遇完成方法 09-08
- 四海兄弟故乡匕首怎么投掷 投掷匕首操作方法 09-08
- 病态金属多少钱 游戏发售价格一览 09-08
- 四海兄弟故乡格挡按键是哪个 格挡使用方法介绍 09-08