【Error】Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this is

由于使用Group by字段,及select 后的字段较多,导致此错误

1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this is incompatible with sql_mode=only_full_group_by

解决方法:

Linux:  /etc/mysql/conf.d/mysql.cnf

vi编辑模式:新增

[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

如下图:

【Error】Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this is_第1张图片

然后重启mysql即可

/etc/init.d/mysqld restart 

 

 

参考

https://sourceforge.net/p/allocpsa/discussion/773745/thread/d36b44e0/?limit=25

你可能感兴趣的:(Java,Mac,Linux,mysql)