我在使足球/橄榄球进入前10名得分手方面遇到问题。
我有这样的事情: SQLFiddle
SELECT p.*, count(*) as num_goals
FROM match_goals g
INNER JOIN match_players p ON g.match_player_id = p.id
INNER JOIN matches m ON m.id = p.match_id
WHERE p.is_deleted = 0 AND
g.is_own_goal = 0 AND
m.season_id = 2
GROUP BY p.id
ORDER BY num_goals DESC
LIMIT 10
我有同一位球员进球不同。
总和不是。显示6球和2球。但是它是同一位球员..和同一支球队..