SELECT teamgets the team and player who scored the most goals for his team
, player
, goals
FROM stats AS t
WHERE goals =
( SELECT MAX(goals) FROM stats WHERE team = t.team )
SELECT t.team
, t.player
, t.goals
FROM stats AS t
INNER
JOIN ( SELECT team
, MAX(goals) AS maxgoals
FROM stats
GROUP BY team ) AS m
ON m.team = t.team
AND m.maxgoals = t.goals
Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.