UNION
を使用してそれを行うことができます :
SELECT team, SUM(points) AS total_points
FROM (
SELECT team_home AS team,
CASE
WHEN team_home_goals > team_away_goals THEN 3
WHEN team_home_goals = team_away_goals THEN 1
ELSE 0
END AS points
FROM games
UNION ALL
SELECT team_away AS team,
CASE
WHEN team_away_goals > team_home_goals THEN 3
WHEN team_away_goals = team_home_goals THEN 1
ELSE 0
END AS points
FROM games ) AS t
GROUP BY team
ORDER BY total_points DESC