Pages

ORA S’ Corner : ORA-00937 not a single-group group function


                                                       


Recently, I came across issue when trying to include both a group function and individual column expression.

Cause: A SELECT list cannot include both a group function and an individual column expression, unless the individual column expression is included in a GROUP BY clause.

Example: 






















Workaround:

You can Drop either the group function or the column expression from the SELECT list or else add GROUP BY clause that includes all individual column expressions listed.





















Quick recap about Group functions

What Are Group Functions?

Group functions operate on sets of rows to give one result per group and each of the functions accepts an argument.

Types of Group Functions
Ø  AVG
Ø  COUNT
Ø  MAX
Ø  MIN
Ø  STDDEV
Ø  SUM
Ø  VARIANCE


Enjoy learning ! 
RinZi ..   










No comments:

Post a Comment