我从 Supabase 开始,想了解如何SUM()
在SELECT
.
我注意到COUNT
我们使用:
const { data, error, range, count } = supabase
.from('table')
.select('*', { count: 'exact' })
有没有类似的东西SUM
我没有注意到?
我的查询是这样的:
select
"GE_PRODUCTS",
sum("GE_QUANTITY") as Quantity,
sum("GE_SALEVALUE") as Revenue
from "GE_SELLS"
where "GE_ENTERPRISE" = 'G.E.'
and "DELETED" <> '*'
group by "GE_PRODUCTS"
order by Revenue desc
limit 3;