sqlite select split string

Solutions on MaxInterview for sqlite select split string by the best coders in the world

showing results for - "sqlite select split string"
Ilaria
30 Jul 2017
1-- using your data table assuming that b3 is suppose to be b2
2
3WITH split(one, many, str) AS (
4    SELECT one, '', many||',' FROM data
5    UNION ALL SELECT one,
6    substr(str, 0, instr(str, ',')),
7    substr(str, instr(str, ',')+1)
8    FROM split WHERE str !=''
9) SELECT one, many FROM split WHERE many!='' ORDER BY one;
10
11a|a1
12a|a2
13a|a3
14b|b1
15b|b2
16c|c2
17c|c1