PostgreSql : Json Array to Rows using Lateral Join
问题 I have two following JSON Array in details field of my table and need to evaluate the query as I use in another relational table. { "city": "London", "name": "Sainburry", "quantities": [112, 145, 222, 122, 124], "prices": [4, 4, 4, 0, 3], "dates": ["13.05.2020", "14.05.2020", "15.05.2020", "16.05.2020", "17.05.2020"] } I want to evaluate the following query for this JSON Array: select quantities, prices, AVG(quantities/prices::float) as ratio from my_table where city = 'London' group by