October 21, 2024
Chicago 12, Melborne City, USA
SQL

How to flatten a json array string in Redshift


I have a table like this:

id       stage(varchar)
1        ["a","b"]
2        ["c"]

and I need to retrieve the data as the following format:

id       stage
1        a
1        b
2        c

How should I write my SQL in AWS Redshift?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video