ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate
2017-06-12 10:02
821 查看
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'DBname.table.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
平台: Mac OS X报错: incompatible with sql_mode=only_full_group_by
版本: mysql Ver 14.14 Distrib 5.7.16, for osx10.11 (x86_64) using EditLine wrapper
参考: https://stackoverflow.com/questions/23921117/disable-only-full-group-by 搜索: "version 5.7.11 running on Mac OS X"
解决办法:
1)命令行登录mysql
2)执行语句:
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";
3)搞定
==================== 成功案例 ======================
mysql> select t.id from transactions t,transaction_info i where t.id=i.t_id group by i.email order by i.email ASC; ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'DBname.table.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 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"; Query OK, 0 rows affected (0.01 sec) mysql> select t.id from transactions t,transaction_info i where t.id=i.t_id group by i.email order by i.email ASC; +-------+ | id | +-------+ | 436 | | 7425 | | 9372 | +-------+
相关文章推荐
- [Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated colum
- [Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated colum
- mysql5.7 报错1055:Expression #1 of SELECT list is not in GROUP BY clause and contains non
- #1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i
- mysql遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
- mysql错误:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ga
- MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”
- Docker安装MySQL遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
- Docker安装MySQL遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
- mysql遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonag
- Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.
- mysql遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
- #1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i
- MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”
- [Err] 1055 - Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated colum
- #1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i
- mysql遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
- [mysql] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'lo
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c