I'm trying to split one column into up to five around the " > " delimiter but the things I've tried haven'tw orked:
I tried
select
id,
compoundColumn,
split(compoundColumn," > ")[1] as "first"
split(compoundColumn," > ")[2] as "second"
from table
where compoundColumn is not null
which didn't work, and
this which sort of did (the first part anyway, not the nth part)
select
id,
compoundColumn,
first(split(compoundColumn," > ")) as "first"
nth(compoundColumn," > ")[n] as "second"
from table
I've found lots of examples on here but they all seem to be saying to use the brackets but the brackets throw an error:
Exception: Malformed SQL. More information: Error with SQL statement: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[1] as "first" from table where compoundColumn IS NOT NULL' at line 3.