【发布时间】:2019-10-19 16:31:26
【问题描述】:
我有一个名为 games(game_id, home_id, home_score, away_id, away_score, date) 的表和一个名为 team(team_id, team_name) 的表。我需要一个 SQL 查询来根据 home_score 和 away_score 计算每支球队的总输赢和赢百分比(赢/场数)记录。
select game_id, home_score, away_score, case when home_score > away_score then 'true' else 'false ' end from game_schedule
试过这个,但不能让它做我想做的事。谢谢!
【问题讨论】:
标签: sql