如何在不进行多次查询的情况下从表中获取数据总和?

I am currently running this query:

SELECT *, COUNT(name) AS ActionCount 
FROM plays 
GROUP BY name 
ORDER BY ActionCount DESC LIMIT 0, 50

To select the most prominent/common names in a game of mine, how would I also get the total sum of the mileage every player drove through without running a query for every one of the 50 users selected above assuming I have a 'mileage' field in every game.

I would have expected that:

SELECT 
  *, 
  COUNT(name) AS ActionCount,
  SUM(mileage) AS totalMileage 
FROM plays 
GROUP BY name
ORDER BY ActionCount DESC LIMIT 0, 50

Would do it.

It doesn't seem particularly tricky to me?