我正在尝试运行此功能,但上面的错误消息仍在继续。我已经尝试了一切,但似乎没有用。请任何人帮忙!!!
SELECT tblGameResults.MatchNumber,
Sum(tblPlayerStatistics.Fouls_Made) AS Fouls
FROM tblGameResults
INNER JOIN tblPlayerStatistics ON tblGameResults.MatchNumber = tblPlayerStatistics.MatchNumber
WHERE (((tblGameResults.Date_Of_Game)=[Date_Of_Game])
AND ((tblGameResults.Place_Of_Game)=[Place_Of_Game]));
答案 0 :(得分:5)
您需要GROUP BY
对聚合值进行分组:
SELECT
tblGameResults.MatchNumber,
Sum(tblPlayerStatistics.Fouls_Made) AS Fouls
FROM
tblGameResults
INNER JOIN
tblPlayerStatistics ON tblGameResults.MatchNumber = tblPlayerStatistics.MatchNumber
WHERE (((tblGameResults.Date_Of_Game)=[Date_Of_Game])
AND ((tblGameResults.Place_Of_Game)=[Place_Of_Game]))
GROUP BY
tblGameResults.MatchNumber;