Table of contents
TOC
折叠目录
展开目录

HAVING 子句没有分组或聚合。(错误 3091)HAVING clause without grouping or aggregation. (Error 3091)

office 365 dev account|上次更新日期: 2017/9/25
|
1 参与者

适用于:访问 2013年 |访问 2016 年Applies to: Access 2013 | Access 2016

此错误发生在查询对 SELECT 语句中的标识符进行求值时。发生此错误是因为未在 HAVING 子句前指定 GROUP BY 子句,或者因为 HAVING 子句中引用的列不在 AGGREGATE 函数中。例如,SELECT col1 FROM table1 HAVING col1 > 20 将发生此错误。如果该语句更改为 SELECT col1 FROM table1 GROUP BY col1 HAVING col1 > 20,则该语句有效。或者,下面的语句也有效 SELECT col1, count(col2) FROM table1 GROUP BY col1 HAVING count(col1) > 20。This error occurs when the query evaluates the identifiers in the SELECT statement. The error occurs because a GROUP BY clause is not specified before the HAVING clause or because the column referenced in the HAVING clause is not in an AGGREGATE function. For example this error would occur with SELECT col1 FROM table1 HAVING col1 > 20. If the statement was changed to SELECT col1 FROM table1 GROUP BY col1 HAVING col1 > 20, then the statement would be valid. Alternatively, the following would be valid SELECT col1, count(col2) FROM table1 GROUP BY col1 HAVING count(col1) > 20.

访问支持资源ACCESS SUPPORT RESOURCES
访问 MSDN 上的开发人员论坛Access for developers forum on MSDN
Support.office.com 的访问帮助Access help on support.office.com
Answers.microsoft.com 的访问帮助Access help on answers.microsoft.com
特定的访问权限错误代码,在 Bing 上搜索Search for specific Access error codes on Bing
访问论坛 UtterAccess 上Access forums on UtterAccess
访问 wiki 上 UtterAcessAccess wiki on UtterAcess
访问开发人员和 VBA 编程帮助中心 (FMS)Access developer and VBA programming help center (FMS)
在 StackOverflow 上访问张贴内容Access posts on StackOverflow

© 2018 Microsoft