Django: GROUP BY two values
Posted
by AP257
on Stack Overflow
See other posts from Stack Overflow
or by AP257
Published on 2010-05-26T20:39:58Z
Indexed on
2010/05/26
20:41 UTC
Read the original article
Hit count: 178
django
I would basically like to do the same as this question, but grouping by combinations of two values, rather than just one:
SELECT player_type, team, COUNT(*) FROM players GROUP BY player_type, team;
Does anyone know whether, and how, this is possible in Django? I'm using 1.2.
© Stack Overflow or respective owner