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;
Reasons:
Blacklisted phrase (1): I have the same problem
RegEx Blacklisted phrase (2.5): Have you found a solution