Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

ORA-00979: Not a GROUP BY Expression Tips

Oracle Error Tips by Burleson Consulting

 

Use of the oerr utility reveals the following information on the ORA-00979 error:

ORA-00979 not a GROUP BY expression

Cause: The GROUP BY clause does not contain all the expressions in the SELECT clause. SELECT expressions that are not included in a group function, such as AVG, COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, must be listed in the GROUP BY clause.

Action: Include in the GROUP BY clause all SELECT expressions that are not group function arguments.

ORA-00979 contains two components:

  1. You attempted to execute a SELECT statement which contained a GROUP BY function such as MIN, MAX, SUM or COUNT.
  2. You attempted to execute an expression within the SELECT list which is not in the GROUP BY clause.

To correct ORA-00979, you can include all SELECT expressions in the GROUP BY clause which are not group function arguments. 

Here are three ways to resolve ORA-00979:

  1. Make the expression or column listed in the SELECT list also in the GROUP BY clause by completely rewriting the SELECT statement.
  2. Completely remove the GROUP BY function from the SELECT statement, including MIN, MAX, SUM, and/or COUNT.
  3. If there is an expression which is not in the GROUP BY clause, remove it completely from the SELECT list.

In the vast majority of vases, the ORA-00979 error is caused because a non-aggregated column is not included in the GROUP BY clause.  

For example, in this case, a ORA-00979 error is thrown because the third column in the query is not included in the GROUP BY:

select
    emp_dept,
    emp_id,
    emp_name,
    sum(emp_comissions)
from
    my_emp
group by
    emp_dept,
    emp_id;

ORA-00979: not a GROUP BY expression


 

 

��  
 
 

 
 
 
 
oracle dba poster
 

 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright ? 1996 -  2014

All rights reserved by Burleson

Oracle ? is the registered trademark of Oracle Corporation.