I have a postgresql table which has a column in json format.
Sample column value:
{"Apple":{"category":"fruit","price":100},"Orange":{"category":"fruit","price":80}}
Now I want to select this column, and extract the "price" for all items in each row.
Query to get column:
select items from my_table
To extract the json value for a specific item, I can use
select items -> 'Orange' -> 'price' as price
from my_table
But how do I extract the price for all the items (Apple, Orange)? As an array maybe.