Skip to content
Advertisement

Getting all the values in json array in snowflake

I have a JSON array as follows:

This Json data is in the field called col1 in my_table

Here is my SQL to parse the JSON array:

My output is

But I want the output to be like

I have used used the lateral flatten but it didn’t work

Advertisement

Answer

Using FLATTEN:

Output:

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