最新下载
热门教程
- 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) |
|
相关文章
- 植物大战僵尸怎么创建新账号 03-31
- 谷歌浏览器怎样进行安全检查 03-31
- 钉钉群公告无法修改怎么办 03-31
- 作业帮网页版入口手机版在哪 03-31
- 凡文阅读如何使用 03-31
- PPT里图片怎么批量保存 03-31