Opened 5 years ago

Closed 5 years ago

#30394 closed Bug (duplicate)

Mutiple annotation with Sum return wrong values.

Reported by: Gouri Javed Owned by: nobody
Component: Database layer (models, ORM) Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Gouri Javed)

UserRoleAccount.objects.annotate(count=Sum(Case(When(user_observations_takengroup=grp,then=1)),default=0,output_field=IntegerField(),distinct=True)).annotate(count1=Sum(Case(When(user_observations_givengroup=grp,then=1)),default=0,output_field=IntegerField(),distinct=True))

Change History (2)

comment:1 by Gouri Javed, 5 years ago

Description: modified (diff)
Version: 2.21.11

comment:2 by Simon Charette, 5 years ago

Resolution: duplicate
Status: newclosed

As documented this is a duplicate of #10060.

Note: See TracTickets for help on using tickets.
Back to Top