I have the same problem
Have you found a solution?
SELECT "name", SUM("h") AS "total hits"
FROM "teams"
JOIN "performances" ON performances.team_id = teams.id
WHERE performances."year" = 2001
GROUP BY "team_id"
ORDER BY sum("h") DESC
LIMIT 5;