I have a table in my db that has a column containing json records.
id | json_records
---+-------------
0 | "[{'x1' : 1234, 'x2' : 5678},{'x1' : 2345, 'x2' : 6789}]'
1 | "[{'x1' : 4321, 'x2' : 8765},{'x1' : 5432, 'x2' : 9876}]'
I would like to get something like this:
id | x1 | x2
---+------+-----
0 | 1234 | 5678
0 | 2345 | 6789
1 | 4321 | 8765
1 | 5432 | 9876
but I am having trouble getting the query to work:
select json_populate_recordset(json_records) from my_table
The few examples I've seen using json_populate_recordset insert the results into a table, but I am just trying to return the results. Is there a way to do this without creating a new table?