hi all, Can i order by of an sum aggregate? this i...
# orm-help
j
hi all, Can i order by of an sum aggregate? this is my code but it not work, it works with count as in document https://www.prisma.io/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#groupby-and-ordering
Copy code
const groupLeader = await ctx.prisma.transaction.groupBy({
          by: ['userId'],
          where: {...},
          _sum: {
            quantity: true,
          },
          orderBy: {
            _sum: {
              quantity: 'desc',
            },
          },
        })
r
@John Smeeth ๐Ÿ‘‹ Unfortunately we donโ€™t support ordering on aggregates like sum. It would be great if you could create a feature request here so that we can look into this ๐Ÿ™‚
j
thank you @Ryan
๐Ÿ‘ 1