mysql报错,显示 1055 - Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'registration.major.MId' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by ,附上我的代码,谁能解决一下谢谢
SELECT course.CName,AVG(register.Score) as 平均成绩,MAX(register.Score) as 最高成绩,MIN(register.Score) as 最低成绩,major.MId,student.SMajor
FROM register,course,major,student
WHERE course.CId=register.CId AND major.MId=student.SMajor
GROUP BY course.CName;
同问,解决了?
去掉sql_mode的only_full_group_by值,在5.7.5之前,MySQL没有检测到功能依赖项,only_full_group_by在默认情况下是不启用的。
select的属性必须出现在group by中