Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在运行此查询:
SELECT *, COUNT(name) AS ActionCount FROM plays GROUP BY name ORDER BY ActionCount DESC LIMIT 0, 50
要在我的游戏中选择最突出/最常见的名称,如果我有一个“里程”字段,我如何在不为上面选择的 50 个用户中的每个用户运行查询的情况下获得每个玩家驾驶的总里程数在每场比赛中。
我本来希望:
SELECT *, COUNT(name) AS ActionCount, SUM(mileage) AS totalMileage FROM plays GROUP BY name ORDER BY ActionCount DESC LIMIT 0, 50
会做的。
对我来说似乎不是特别棘手?