How to query as GROUP BY in Django?

Posted by Rohit Kumar | Updated on

If you want to query as GROUP BY in Django? If you mean to do aggregation you can use the aggregation features of the ORM:

This results in a query similar to

and the output would be of the form

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers