Mysql中 only_full_group_by 配置致使报错的状况

Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column '×××' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_bysql

Mysql 5.7以上版本中数据库

数据库命令 select @@sql_mode 会打印出一些配置,当其中有only_full_group_by的时候,当select 出的数据 除聚合函数外,有不包含在group by 中的字段时,会向上面这样报错函数

only_full_group_by 配置的做用,就是约束sql语句中group by的用法,即select 中的列,必须是包含在group by 中列或者聚合函数this

 

 

 

 

--spa

相关文章
相关标签/搜索