#32155: Count() by default uses group by
-------------------------------------+-------------------------------------
Reporter: Sukhinder Mann | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* status: new => closed
* resolution: => invalid
Comment:
I think you're misunderstanding the `annotate` vs `aggregate` features of
the ORM.
Annotations of aggregate functions have no choices but to group by the
queryset's model to provide a result for each rows. If you want to perform
an aggregation over filtered rows without grouping you'll want to use
`aggregate` instead.
https://docs.djangoproject.com/en/3.1/topics/db/aggregation/
Please use support channels and consult documentation before filling a
ticket next time as we use Trac solely for tracking feature requests and
confirmed bugs.
https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
--
Ticket URL: <https://code.djangoproject.com/ticket/32155#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.9e75e9fe4a23ff94427c6ef56631d871%40djangoproject.com.