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