0

我有以下查询:

select teams.`team_name`, count(matches.`played_team`) 
from teams 
join matches on teams.`team_number` = matches.`played_team` 
group by teams.`team_name`

它用于显示球队名称、球队号码和他们参加过的比赛数量。我希望在这个查询中添加一个 WHERE 子句,它只计算 2011 年 1 月 1 日之后玩的游戏数。matches.date保存有关比赛日期的信息。谢谢!

4

1 回答 1

0
select teams.`team_name`, count(matches.`played_team`) 
from teams 
join matches on teams.`team_number` = matches.`played_team`
WHERE `matches.date` > '2011-01-01' 
group by teams.`team_name`
于 2012-12-02T20:19:06.897 回答