mysql出现which is not functionally dependent on columns in GROUP BY clause报错


方案一:修改SQL语句,每个字段前加上any_value

SELECT any_value(id) AS id,any_value(uid),any_value(rid) FROM user WHERE (id = '125') GROUP BY uid;

方案二:修改数据库配置

1、查询模式

select @@sql_mode;

2、 修改配置文件my.ini/mysql.ini

# 增加下面一行
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

转自https://blog.csdn.net/chengqiuming/article/details/106034357


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 mysql 执行报错:Error querying database. Cause: java.sql.SQLSyntaxErrorException:which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by问题分析 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this [mysql] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'loser.tank_admin.login_ip' which is not functionally dependent on columns in GROUP BY clause; this is SELECT list is not in GROUP BY clause and contains nonaggregated column 't_user_rel.distance' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=on 数据库多表连接查询中使用group by分组语句,Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'XXX' which is not functionally dependent on columns in GROUP BY claus 【mysql报错】MySQL5.7.27报错[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated MySQL出现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 nonaggre
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM