我正在尝试运行查询,但收到以下错误:
SQL Error (1055): Expression #14 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'gamesmart.gps.plays' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
当我检查 sql_mode
时,它的 session
和 global
均设置为以下内容:
那么,为什么它仍然给我这个错误?
Mysql版本:5.7.14
最佳答案
尝试解决由于 5.7 要求而产生的查询:
- 通过设置 sql_mode 禁用“only_full_group_by”。不是 推荐!
- 通过设置适当的参数来重写您的查询 der group by 列表中的列名称
- 设置 ANY_VALUE(fieldname) 范围内 如果您确实知道这就是您所期望的,则您的 SELECT 查询。
关于mysql - 与 sql_mode 'only_full_group_by' 不兼容但未设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41856268/