Sum groupBY query


#1

i have a tabe of accounting transaction (billnumber ,date,sum). i need to get result of every bill his total (bill number, total).


#2

i found the way .the documantation wasnt clear to me
const lines = await database.select(‘bill’)
.from(‘tnuot’)
.sum(‘bruto as b’)
.groupBy(‘bill’);
it add field name ‘b’ for interpulation