Mysql5.7遇到运行sql order by 使用 group字段时出错的解决办法

[Err] 1055 - nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'swh.attendee.attendee_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

  解决办法:

1、在mysql中使用下列查询语句:

select @@sql_mode

2、在my.cnf(my.ini)中修改配置项:sql_mode(把查询到的值删掉only_full_group_by这个选项,其他的都复制过去):

sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

  

posted @ 2018-06-27 00:35  finary  阅读(860)  评论(0编辑  收藏  举报