select c_no,AVG(sc_degree) from score where s_no IN (select s_no from student where s_class = '95031');
運行上述查詢時,彈出一下錯誤
select c_no,AVG(sc_degree) from score where s_no IN (select s_no from student where s_class = '95031')
> 1140 - In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'school_test.score.c_no'; this is incompatible with sql_mode=only_full_group_by
> 時間: 0.001s
經過查詢資料和測試,當mysql的sql_mode是only_full_group_by的時候,在不使用group by 並且select后面出現聚集函數的話,那么所有被select的都應該是聚集函數,否則就會報錯