SELECT list is not in GROUP BY clause and contains nonaggregated

1.问题
mysql 5.7报错
SELECT list is not in GROUP BY clause and contains nonaggregated
SELECT list is not in GROUP BY clause and contains nonaggregated_第1张图片
2.解决方式
mysql 5.7版本 sql_mode默认值
在这里插入图片描述
需要去掉 第一个

mysql命令行执行
mysql> set global sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;
mysql> set session sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;

修改对于新的客户端连接生效!所以,重启项目

你可能感兴趣的:(异常以及其他问题解决,mysql,数据库,sql)