我有表匹配,我需要目标总和。如果Match.Home_team='Tupesy'
我需要总和,Match.Home_team='Tupesy'
否则sum
。Match.Away_goals
现在我有了这个,但完全错误:/
SELECT *,
CASE (Match.Home_team)
WHEN (Match.Home_team='Tupesy')THEN (SUM(Match.Home_goals))
ELSE (SUM(Match.Away_goals))
END
FROM Match
Where (Match.ID_match='1');