当前位置:网站首页>[SQL] string series 2: split a string into multiple lines according to specific characters
[SQL] string series 2: split a string into multiple lines according to specific characters
2022-04-23 20:37:00 【Wood is easy to follow the wind】
Break a string into multiple lines according to specific characters , for example : Will Mathematics , Physics , history , biological , Chinese language and literature , English , chemical , Geographical division 8 Row display .
Select * From dbo.StrToColEx(' mathematics , Physics , history , biological , Chinese language and literature , English , chemical , Geography ',',') b
- 1.
CREATE function dbo.StrToColEx (@str Varchar(max),@separator varchar(10))
returns @T table(Col varchar(max),sort int)
as
Begin
Declare @i int
declare @index int
set @index=1
Set @i=0
Set @[email protected][email protected]
While(@i<=len(@str))
Begin
Insert @T select substring(@str,@i,charindex(@separator,@str COLLATE Chinese_PRC_CS_AS_KS_WS,@i)[email protected]) ,@index
Select @i=charindex(@separator,@str COLLATE Chinese_PRC_CS_AS_KS_WS,@i)+LEN(@separator)
set @[email protected]+1
End
return
End
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
版权声明
本文为[Wood is easy to follow the wind]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231922596556.html
边栏推荐
- Investigate why close is required after sqlsession is used in mybatties
- Thirty What are VM and VC?
- How can matlab obtain the truncated image in trainingimagelabeler
- 2022dasctf APR x fat epidemic prevention challenge crypto easy_ real
- Syntaxerror: unexpected token r in JSON at position 0
- Easy to use nprogress progress bar
- DOS command of Intranet penetration
- Actual measurement of automatic ticket grabbing script of barley network based on selenium (the first part of the new year)
- A login and exit component based on token
- The problem of 1 pixel border on the mobile terminal
猜你喜欢
Tensorflow 2 basic operation dictionary
Commande dos pour la pénétration de l'Intranet
Preliminary understanding of cache elimination algorithm (LRU and LFU)
LeetCode 116. 填充每个节点的下一个右侧节点指针
【SQL】字符串系列2:将一个字符串根据特定字符分拆成多行
Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
Browser - learning notes
【PTA】整除光棍
Imitation Baidu map realizes the three buttons to switch the map mode by automatically shrinking the bottom
Actual measurement of automatic ticket grabbing script of barley network based on selenium (the first part of the new year)
随机推荐
How to do after winning the new debt? Is it safe to open an account online
SQL Server Connectors By Thread Pool | DTSQLServerTP 插件使用说明
Installation and use of NVM
How to use PM2 management application? Come in and see
Actual measurement of automatic ticket grabbing script of barley network based on selenium (the first part of the new year)
Customize timeline component styles
Zdns was invited to attend the annual conference of Tencent cloud basic resources and share the 2020 domain name industry development report
Linux64Bit下安装MySQL5.6-不能修改root密码
On BIM data redundancy theory
Leetcode 994, rotten orange
6-5 string - 2 String copy (assignment) (10 points) the C language standard function library includes the strcpy function for string copy (assignment). As an exercise, we write a function with the sam
LeetCode 232、用栈实现队列
star
"Meta function" of tidb 6.0: what is placement rules in SQL?
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
bounding box iou
How to configure SSH public key in code cloud
Matlab analytic hierarchy process to quickly calculate the weight
Elastic box model
Confusion about thread blocking after calling the read () method of wrapper flow