hi. I have a query that is doing the sum of jsonb values and I’m using postgres 9.6. So my query looks like this
select t.id, sum(tt.value::text::numeric) val
from my_table t, jsonb_each(total) AS tt
where jsonb_typeof(tt.value) = 'number'
group by t.id
I need to add this sum(tt.value::text::numeric) which I’m not sure how to do it in ecto?