tag:blogger.com,1999:blog-4113082053753185517.post725538824240935480..comments2023-07-02T13:50:28.495+02:00Comments on Samuel Bosch: Selecting comma separated data as multiple rows with SQLiteSamuel Boschhttp://www.blogger.com/profile/00902576471871535529noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4113082053753185517.post-51058411951784685952018-05-01T21:52:06.315+02:002018-05-01T21:52:06.315+02:00Thanks for the code! I parsed my 'note' s...Thanks for the code! I parsed my 'note' string correctly (|-delimited with a : starting the sub_string) and the results returned into a stacked column. Any suggestions to put each sub_string into its own column?<br /><br />WITH RECURSIVE split(a_id, sub_string, rest) AS (<br /> SELECT id, '', note || '|' <br /> FROM activities <br /> WHERE subject LIKE '%Q1-2018%'<br /> UNION ALL<br /> SELECT a_id,<br /> substr(rest, instr(rest, ':')+1, instr(rest, '|')-instr(rest, ':')-1),<br /> substr(rest, instr(rest, '|')+1)<br /> FROM split<br /> WHERE rest <> '')<br />SELECT a_id, sub_string<br />FROM split<br />WHERE sub_string <> ''<br />ORDER BY a_id;Anonymousnoreply@blogger.com