Mysql运行报only_full_group_by的解决方法

2018-06-25  本文已影响0人  皮蛋馅儿

Mysql运行报错:

Query error: Expression #1 of 
SELECT list is not in GROUP BY clause and contains nonaggregated 
column 'tv-admin.ci_match_round_log.role_id' which is not functionally
dependent on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by - Invalid query: SELECT xxx
FROM `table` GROUP BY `xxx`
  1. cmd命令行下:select @@global.sql_mode;
    结果:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  1. 输入:
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';
上一篇 下一篇

猜你喜欢

热点阅读