dependent on columns in GROUP BY clause
时间: 2023-10-15 14:26:05 浏览: 156
解决MySQL 5.7.9版本sql_mode=only_full_group_by问题
"dependent on columns in GROUP BY clause"是指在SQL查询中,如果SELECT列表、HAVING条件或ORDER BY列表引用了未在GROUP BY子句中命名的非聚合列,则会出现这个问题。 这是因为根据SQL-92标准和更早版本,不允许这样的查询。换句话说,如果你在GROUP BY子句中指定了一组列进行分组,那么SELECT列表、HAVING条件和ORDER BY列表中的列必须是这组列的聚合函数或已在GROUP BY子句中命名的列。如果有未命名的非聚合列,则需要重新调整查询以符合SQL语法要求。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [MySQL异常:[Err] 1055 – Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nona...](https://download.csdn.net/download/weixin_38742656/13685329)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [MySQL:dependent on columns in GROUP BY clause解决方案](https://blog.csdn.net/fengyuzaitu_126_com/article/details/118339840)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文