John Smeeth
11/01/2021, 4:08 AMconst groupLeader = await ctx.prisma.transaction.groupBy({
by: ['userId'],
where: {...},
_sum: {
quantity: true,
},
orderBy: {
_sum: {
quantity: 'desc',
},
},
})
Ryan
11/01/2021, 11:45 AMJohn Smeeth
11/02/2021, 1:08 AM