nested json column parsing in redshift

56 views Asked by At

I have following redshift table column and want to parse each key value pair as separate columns/rows in the table.

{"names":[{"name":"bob","months":8,"days":14},{"name":"tom","months":36,"days":0}]}

I tried with json_extract_path_text and getting error. How do I loop through this array and make them as separate columns/rows in a table.

select json_extract_path_text([{"name":"bob","months":36,"days":0}],"name")

Please provide your inputs or direction to implement this using redshift query.

Thanks,Bob

0

There are 0 answers