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 cardBrand information is in a Json .
In this json , I also have a status.
I would like to return the sum of the values grouped by credit card and that in json the status is="SUCCESS".
How can I do this?