---
title: "ORA-00937: not a single-group group function说明及解决方法"
author: "mintelong"
date: "2010-08-27T10:24:25Z"
tags: []
categories: ["Web前端"]
slug: "ora-00937-not-a-single-group-group-function"
draft: false
lastmod: "2010-08-27T10:24:25Z"
id: 748498
url: "https://mintelong.iteye.com/blog/748498"
---

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&gt; select owner, count(\*)  
  2  from dba\_segments;  
select owner, count(\*)  
       *  
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&gt; select owner, count(\*)  
  2  from dba\_segments  
  3  group by owner;

OWNER                            COUNT(\*)  
\------------------------------ ----------  
USER1                              166  
USER2                              166

本文来自CSDN博客，转载请标明出处：[http://blog.csdn.net/smh821025/archive/2009/03/15/3992763.aspx](http://blog.csdn.net/smh821025/archive/2009/03/15/3992763.aspx)