Kenny Tran
10/20/2022, 5:33 AMaggrigate
to sum up a field within a relation query. Have a look at the my query below -
const profiles = await prisma.profile.findMany({
include: {
offer: true,
meeting: true,
sale: true
},
orderBy: {
points: "desc"
},
take: 10
})
I want to get the sum of offer, meeting and sale, IndividuallyTakeo Kusama
10/20/2022, 6:18 AMgroupBy
keeping association id and mapping with nodejs code.
Or use $executeRaw
I ordinarily do for performance.Kenny Tran
10/20/2022, 7:03 AM