SELECT TeamName,
SUM(CASE WHEN Result=’W’ THEN 1 ELSE 0 END) AS Wins,
SUM(CASE WHEN Result=’L’ THEN 1 ELSE 0 END) AS Losses,
SUM(CASE WHEN Result=’D’ THEN 1 ELSE 0 END) AS Draw,
SUM(CASE WHEN Result=’L’ THEN 1 ELSE 0 END) AS Losses,
SUM(CASE WHEN Result=’D’ THEN 1 ELSE 0 END) AS Draw,
Count (*) AS Total
FROM Team
GROUP BY TeamName
FROM Team
GROUP BY TeamName
No comments:
Post a Comment