`
bugyun
  • 浏览: 551492 次
社区版块
存档分类
最新评论

Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggre

 
阅读更多

 

转:https://www.cnblogs.com/zhi-leaf/p/5998820.html

 

错误信息:

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 is incompatible with sql_mode=only_full_group_by

 

具体出错提示:

[Err] 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; this is incompatible with sql_mode=only_full_group_by

 

1、查看sql_mode

select @@global.sql_mode

查询出来的值为:

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

2、去掉ONLY_FULL_GROUP_BY,重新设置值。

set @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

 

 

分享到:
评论

相关推荐

    MySQL异常:[Err] 1055 – Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nona…

    在MySQL中,错误提示 "[Err] 1055 – Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column…” 指的是在执行包含`GROUP BY`子句的查询时,你试图对未在`GROUP BY`子句中...

    mysql遇到Expression.docx

    在MySQL中,当你尝试执行一个包含`GROUP BY`子句的查询时,可能会遇到"Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column"这样的错误。这个错误提示表明你的查询违反了`...

    MySQL5.7中的sql_mode默认值带来的坑及解决方法

    在正常项目开发过程中,如果MySQL版本从5.6升级到5.7版本。作为DBA在考虑数据库版本升级带来的影响时,一般会有几个注意点...ERROR 1055 (42000): Expression #3 of XXXXXX list is not in GROUP BY clause and contain

    解决大于5.7版本mysql的分组报错Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated

    如果`SELECT`列表中的列没有出现在`GROUP BY`子句中,且该列没有被聚合函数(如`SUM`, `AVG`, `MAX`, `MIN`等)处理,MySQL会抛出`Expression #1 of SELECT list is not in GROUP BY clause and contains ...

    mysql不支持group by的解决方法小结

    MySQL中的`GROUP BY`语句用于对数据进行分组,并且通常与聚合函数(如`COUNT`, `SUM`, `AVG`, `MAX`, `MIN`)一起使用,以计算每个分组的汇总信息。然而,在MySQL 5.7.x及更高版本中,默认启用了`ONLY_FULL_GROUP_BY...

    MySQL使用中遇到的问题记录

    本文主要关注的是几个常见的问题及其解决方案,包括因`sql_mode=only_full_group_by`导致的GROUP BY查询错误、清空表数据的方法,以及如何处理MySQL占用过多内存的情况。 首先,`sql_mode=only_full_group_by`是...

    MYSQL数据查询技巧.pdf

    最后,当遇到ORDER BY错误,错误信息提示"Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column...",这是由于SQL模式"only_full_group_by"的要求,该模式下,ORDER BY...

    springclouddemo

    1. **Eureka**:Eureka是Spring Cloud中的核心组件之一,它作为一个服务注册中心,负责管理各个微服务实例的生命周期。当服务启动时,它们会向Eureka注册,并定时发送心跳来证明其存活状态。同时,其他服务通过...

    SQL Server 2012 Transact-SQL DML Reference

    - `SELECT column_name, SUM(column_name) OVER (ORDER BY column_name ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS rolling_sum FROM table_name;` #### Table Value Constructor 表值构造器用于创建临时表,...

    微软内部资料-SQL性能优化5

    The order of pages in the page chain, and the order of rows on the data pages, is the order of the index key or keys. Deciding which key to cluster on is an important performance consideration. When ...

    SSD7 选择题。Multiple-Choice

    (a) filling in skeleton tables of the database with examples of what is to be retrieved (b) placing SQL keywords, such as select, under the column names they want to retrieve (c) typing a ...

    Clause_by_Clause_Explanation_of_ISO_13485_2016_EN.pdf

    ISO (the International Organization for Standardization) is a worldwide federation of national standards bodies (ISO member bodies). The work of preparing International Standards is normally carried ...

    Clause_37_Auto-Negotiation.pdf

    《Clause 37 自协商原理详解》 在现代网络通信技术中,自协商(Auto-Negotiation)是一项关键功能,特别是在千兆以太网(Gigabit Ethernet, GE)环境中。Clause 37 自协商机制是IEEE 802.3标准的一部分,它允许网络...

    微软内部资料-SQL性能优化3

    If the class is not confident in their understanding, review appendix A04_Locking and its accompanying PowerPoint® file. Transactions in SQL Server provide the ACID properties: Atomicity A ...

    Extended Backus Naur Form

    1. **Sequence**: Represents a series of elements that must appear in a specific order. For example, in Ada, a procedure call might consist of the procedure name followed by a list of parameters ...

    Mysql升级到5.7后遇到的group by查询问题解决

    错误提示 "SELECT list is not in GROUP BY clause and contains nonaggregated column 'news.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_...

    delphi 错误大全

    #### '<clause>' clause not allowed in OLE automation section **错误描述:** 如果在 OLE 自动化代码块中使用了不允许的子句,会触发此错误。 **解决办法:** 检查并确认所有在 OLE 自动化部分使用的子句都是...

Global site tag (gtag.js) - Google Analytics