我有以下查询:
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-01-01之后播放的游戏数。 matches.date
保存有关比赛日期的信息。
谢谢!
答案 0 :(得分: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`