java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column 'amc.ti.create_time' which is not in SELECT list; this is incompatible with DISTINCT
今天遇到一个问题,一个sql可以在mysql5.6运行,不能在mysql5.7运行。百度说,可以修改my.cnf,但是mac的mysql没有这配置。继续百度,
http://bbs.csdn.net/topics/391878172page=1,
http://blog.sina.com.cn/s/blog_4f925fc30102e0ot.html
上面句子正确写法:SELECT T.NAME FROM UNIT T WHERE ROWNUM < 10 ORDER BY T.UNITNO;
或者
SELECT DISTINCT T.NAME,T.UNITNO FROM UNIT T WHERE ROWNUM < 10 ORDER BYT.UNITNO;
【注】:加DISTINCT后是把数据先放到一个DISTINCT后的临时集合里然后再进行排序。
相关推荐
在MySQL中,错误提示 "[Err] 1055 – Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column…” 指的是在执行包含`GROUP BY`子句的查询时,你试图对未在`GROUP BY`子句中...
在MySQL中,当你尝试执行一个包含`GROUP BY`子句的查询时,可能会遇到"Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column"这样的错误。这个错误提示表明你的查询违反了`...
在正常项目开发过程中,如果MySQL版本从5.6升级到5.7版本。作为DBA在考虑数据库版本升级带来的影响时,一般会有几个注意点...ERROR 1055 (42000): Expression #3 of XXXXXX list is not in GROUP BY clause and contain
如果`SELECT`列表中的列没有出现在`GROUP BY`子句中,且该列没有被聚合函数(如`SUM`, `AVG`, `MAX`, `MIN`等)处理,MySQL会抛出`Expression #1 of SELECT list is not in GROUP BY clause and contains ...
然而,在MySQL 5.7.x及更高版本中,默认启用了`ONLY_FULL_GROUP_BY`模式,这导致了对`GROUP BY`语句更为严格的解释。在`ONLY_FULL_GROUP_BY`模式下,所有出现在`SELECT`列表中但未包含在`GROUP BY`子句的列必须是...
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘col_user_6.a.START_TIME’ which is not functionally dependent on columns in GROUP BY clause; this is ...
当MySQL执行GROUP BY查询时,如果SELECT列表中包含未在GROUP BY中指定的非聚合列,且该列未包含在聚合函数(如SUM、AVG等)中,就会报错。解决这个问题的方法是调整`sql_mode`的设置。你可以通过登录MySQL并运行以下...
发现问题 最近在将mysql升级到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 c
最后,当遇到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...
- `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 表值构造器用于创建临时表,...
#### '<clause>' clause not allowed in OLE automation section **错误描述:** 如果在 OLE 自动化代码块中使用了不允许的子句,会触发此错误。 **解决办法:** 检查并确认所有在 OLE 自动化部分使用的子句都是...
1. **Eureka**:Eureka是Spring Cloud中的核心组件之一,它作为一个服务注册中心,负责管理各个微服务实例的生命周期。当服务启动时,它们会向Eureka注册,并定时发送心跳来证明其存活状态。同时,其他服务通过...
新安装的MySQL5.7,登录时提示密码错误...in ‘field list’,原来是mysql数据库下已经没有password这个字段了,password字段改成了authentication_string 所以更改语句替换为update mysql.user set authentication_st
(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 ...
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 ...
Tuning ORDER and GROUP BY Section 21.5. Tuning DML (INSERT, UPDATE, DELETE) Section 21.6. Conclusion Chapter 22. Optimizing Stored Program Code Section 22.1. Performance Characteristics of ...
'clause' not allowed in OLE automation section 错误描述:在OLE自动化部分中不允许使用特定子句。 解决方法:仔细检查与OLE相关的代码段,确认是否在自动化部分不当使用了某些子句,应遵循OLE自动化规范进行调整...