我有一个查询SELECT COUNT(TeamID) AS "Team size" FROM tblteamplayers GROUP BY TeamID
,它会返回每个团队中的玩家数量,如下所示:
+---+
| 1 |
| 2 |
| 1 |
| 3 |
| 3 |
| 5 |
| 1 |
+---+
但我需要计算此示例中每个团队规模列出的项目数量:
+---+---+
| 1 | 3 |
| 2 | 1 |
| 3 | 2 |
| 5 | 1 |
+---+---+
答案 0 :(得分:1)
在外部查询中再次分组:
mouse-ycor