Mysql5.7版本(group by)相关only_full_group_by

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'orgGc.gradeName' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

查询官方相关资料,发现“only_full_group_by”SQL_MODE是默认开启的。关于它的详细介绍移步官网,看下详细的说明吧。具体地址如下:
官方参考资料:
http://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html //group by
http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html // sql_mode

解决方法:
对于select中获取非group by的信息,则要通过any_value()函数

你可能感兴趣的:(Mysql5.7版本(group by)相关only_full_group_by)