Select 2 json information

Asked

Viewed 28 times

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?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.