I got a table TABVAR in snowflake which has column Var_Col which is VARIANT type. I load there each row from some csv, so values are like 'val1;val2;val3'.
I know that i can query it as columns directly from csv, but i have to do it other way.
The question is how to query Var_Col to obtain something like:
select firstValFromVar_Col, secondValFromVar_Col, thirdValFromVar_Col from TABVAR
I mean the query like above and result be like:
Col1 Col2 Col3 val1 val2 val3
Output of Select * from TABVAR :
Var_Col val1;val2;val3
It can be done with:
select split_part("Var_Col", ';', 1) , split_part("Var_Col", ';', 2) , split_part("Var_Col", ';', 3) from "TABVAR"
2.1m questions
2.1m answers
60 comments
57.0k users