我有這樣的MS Access查詢計算平均:問題與MS Access和一列
SELECT DISTINCT
Career.careerId, Student.studentName, Avg([Student-Topic].grade), Career.careerName
FROM
Career INNER JOIN
(
(Student INNER JOIN [Student-Topic]
ON Student.studentId = [Student-Topic].studentId)
INNER JOIN [Student-Career]
ON Student.studentId = [Student-Career].studentId)
ON Career.careerId = [Student-Career].careerId
WHERE
(((
[Student-Career].careerId)=[Career].[careerId]) AND
(([Student-Topic].studentId)=[Student].[studentId]));
沒有AVG函數的查詢工作正常,但是當我把它,它打破了......
什麼是我的錯誤?
什麼是「發生故障」呢?錯誤信息會非常有用。既然你正在使用一個聚合函數,你很可能需要一個GROUP BY子句。 – 2011-05-19 18:52:46