E
E
Eugene2020-08-27 16:20:45
PostgreSQL
Eugene, 2020-08-27 16:20:45

How to calculate aggregation in json field in postgresql?

[{"id":1, "amount": 5}, {"id":2, "amount": 10}]
How to calculate relative amount using sql? I want to get
id = 1, amount = 5/15
id = 2, amount 10/15

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question