ORA-00937: not a single-group group function的解決方法
轉自:http://space.itpub.net/23184238/viewspace-630395
A SELECT list cannot include both a group function, such as AVG, COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, and an individual column expression, unless the individual column expression is included in a GROUP BY clause.
Drop either the group function or the individual column expression from the SELECT list or add a GROUP BY clause that includes all individual column expressions listed.
eg:
SQL> select inst_id,count(*) from gv$session;
select inst_id,count(*) from gv$session
*
ERROR at line 1:
ORA-00937: not a single-group group function
Because we have a group function (COUNT) in our column list, and an additional column (OWNER), we have to include the GROUP BY clause in our select statement.
SQL> select inst_id,count(*) from gv$session group by inst_id;
INST_ID COUNT(*)
---------- ----------
1 31
2 29
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14663377/viewspace-1034992/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-00937: not a single-group group functionFunction
- ORA-00937——Oracle中GROUP BY搭配CASE WHEN的一則SQL報錯OracleSQL
- [BUG反饋]public function group() 方法缺少網頁標題賦值Function網頁賦值
- 解決Win7開機提示group policy client無法登陸的方法Win7client
- error: use of deleted function ‘YYSTYPE::YYSTYPE()’[解決]ErrordeleteFunction
- [HP-UX] ERROR: Function activate_volume_groupUXErrorFunction
- distinct 多列問題 group by 解決
- win10執行戰地3彈出directx function報錯的解決方法Win10Function
- TEMP表空間不足解決 - temp group
- laravel 解決 mysql only_full_group_by 問題LaravelMySql
- TabError的解決方法Error
- ArtifactDescriptorException的解決方法Exception
- YII2.0 jQuery(…).activeform is not a function in 終極解決方案jQueryORMFunction
- Java 中的泛型方法及 FunctionJava泛型Function
- oracle group by的按照不同粒度聚合方法Oracle
- mysql 禁用 ONLY_FULL_GROUP_BY,暫時解決錯誤(sql_mode=only_full_group_by)MySql
- ABAP function group和Tomcat library重複載入問題FunctionTomcat
- This function has none of DETEMINISTIC,NO SQL錯誤解決辦法FunctionNoneSQL
- vue 父子元件傳值報錯:this.$emit is not a function 解決Vue元件MITFunction
- MySQL5.7 group by新特性報錯1055的解決辦法MySql
- oracle partition by group by,詳解partition by和group by對比Oracle
- Function方法和屬性圖Function
- 3.1 - Laravel - 5.6 - Route - Group方法Laravel
- dns劫持怎麼解決 dns劫持的解決方法DNS
- SQL改寫的方法,select group by sumSQL
- 建立cache group 時遇到 錯誤5120 時候的解決方案
- 遇到問題的解決方法
- 求事務的解決方法
- Mysql關於procedure、function的詳解MySqlFunction
- javascript function的多種用法詳解JavaScriptFunction
- ThinkPHP函式提示錯誤function undefined的方法PHP函式FunctionUndefined
- error LNK2019:unresolved external symbol *** referenced in function ***的解決方案ErrorSymbolFunction
- ORA-29702:error occurred in Cluster Group Service operation錯誤解決Error
- 解決laravel出現Syntax error or access violation: 1055 ‘***‘ isn‘t in GROUP BYLaravelError
- ORA-00313 open failed for members of log group解決辦法AI
- 金沙不給提款的解決方法
- 跨域的九種解決方法跨域
- pycharm不支援django的解決方法PyCharmDjango