Opened 6 years ago
Last modified 6 years ago
#30394 closed Bug
Mutiple annotation with Sum return wrong values. — at Version 1
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 )
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))
Note:
See TracTickets
for help on using tickets.