美文网首页
Mysql运行报only_full_group_by的解决方法

Mysql运行报only_full_group_by的解决方法

作者: 皮蛋馅儿 | 来源:发表于2018-06-25 18:40 被阅读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';

相关文章

网友评论

      本文标题:Mysql运行报only_full_group_by的解决方法

      本文链接:https://www.haomeiwen.com/subject/omxuyftx.html