我使用 Django 查询作为:
sports.PYST.objects.using( 'sports-data' ).all().values('season','player','team').annotate(max_count = Max('punt_long') ).query
它给出了像这样的o/p:
SELECT `PYST`.`SEASON`, `PYST`.`PLAYER`, `PYST`.`TEAM`, MAX(`PYST`.`PUNT_LONG`) AS `max_count` FROM `PYST` GROUP BY `PYST`.`SEASON`, `PYST`.`PLAYER`, `PYST`.`TEAM` ORDER BY NULL
我的期望:
select season,player,team,max(punt_long)as punt_long from PYST group by season
任何人都可以对此提供帮助或需要任何其他信息吗?