Home > Database > Mysql Tutorial > sqlserver以‘/’拆分数据

sqlserver以‘/’拆分数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 14:57:44
Original
1071 people have browsed it

做需求时需要拆分一个数据列,在网上查了各种高大上的代码,可惜不好用。索性自己写一个demo居然勉强可用。嘻嘻 无 SELECT substring(columnname,0,CHARINDEX('/',a)) as firststr,substring(columnname,CHARINDEX('/',columnname)+1,len(columnname)-CHARIND

做需求时需要拆分一个数据列,在网上查了各种高大上的代码,可惜不好用。索性自己写一个demo居然勉强可用。嘻嘻
SELECT substring(columnname,0,CHARINDEX('/',a)) as firststr,substring(columnname,CHARINDEX('/',columnname)+1,len(columnname)-CHARINDEX('/',columnname)) as secondstr
  FROM talbename
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template