SQLite Forum

[Feature Request] split string table-valued function
Login
You can adapt the answer to this question to your needs.
<https://stackoverflow.com/questions/24258878/how-to-split-comma-separated-value-in-sqlite/32051164#32051164>


```
WITH split(word, str) AS (
    -- alternatively put your query here
    -- SELECT '', category||' ' FROM categories
    SELECT '', 'Auto A 1234444'||' '
    UNION ALL SELECT
    substr(str, 0, instr(str, ' ')),
    substr(str, instr(str, ' ')+1)
    FROM split WHERE str!=''
) SELECT word FROM split WHERE word!='';
```

Output is as expected:

```
Auto
A
1234444```