1
I have the following select to query in the bank the sum of the values of a given day and group by cardBrand.
select SUM (amount::numeric)/100, response ->> 'cardBrand'
from fatura where duedate::date ='2018-06-15'
group by response ->> 'cardBrand'
The information of cardBrand is in a Json.
In that json, I also have a status.
I would like to return the sum of the amounts grouped by credit card and that in json status is = "SUCCESS".
How can I do that?