Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
split a string into pairs of words
DECLARE @TourCodes VARCHAR(4000); SET @TourCodes = ' AVG123 , JGH12,AVasfG123,JGsdfH12,AVsdgG123,JsdgGH12 , A34G123,J56gGH12, A34G1df23,JgfGH12'; with rcrs AS ( select rtrim(ltrim(LEFT(@TourCodes,charindex(',',@TourCodes)-1))) first, SUBSTRING(@TourCodes+',',charindex(',',@TourCodes)+1,4000) other, 0 flg union all select rtrim(ltrim(LEFT(other,charindex(',',other)-1))) first, SUBSTRING(other,charindex(',',other)+1,4000) other , flg+1 flg FROM rcrs WHERE charindex(',',other)>0 ) select a.first one,b.first two from rcrs a INNER JOIN rcrs b ON b.flg=a.flg+1 WHERE a.flg%2=0
run
|
edit
|
history
|
help
0
JSON with No root node - Format from XML output - SQL
Sql server 2012 features list
Insert multiple parent-child records
jueves(08)
gfhrey
string conversion
arp
FIGURA5.2
DDL,DQL,DML
for xml path concatenation ordered by seqno