Skip to content
Advertisement

How to parse a list within a table in Snowflake using SQL

So I have a table as such:

I would like to restructure this data so that each list element becomes its own row. If VALUE is an empty list, the expectation is it does not appear in the final dataset.

Final result should be:

I think using FLATTEN() in Snowflake should work here but I cant seem to get it.

Advertisement

Answer

I use the FLATTEN version:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement