The following table lists the Behavior of Group Functions and Null Values

Set X | SUM(X) | MIN(X) | AVG(X) | MAX(X) |
---|---|---|---|---|

{1,2,3,NULL} | 6 | 1 | 2 | 3 |

{1,2,3,0} | 6 | 0 | 1.5 | 3 |

{1,2,3,2} | 8 | 1 | 2 | 3 |

The SUM function does not make any distinction between {1,2,3,NULL} and {1,2,3,0}.

The MIN and AVG functions don't make any distinction between {1,2,3,NULL} and {1,2,3,2}.

The MAX function gives the same result on all three sets.

- Group Functions
- Group Functions and Duplicate Values, DISTINCT
- Count different courses are scheduled for each trainer and the total number of scheduled courses
- Grouping the Results of a Join
- COUNT(*) Function
- Valid SELECT and GROUP BY Clause Combinations
- Group on column expressions
- GROUP BY ROLLUP
- GROUP BY CUBE
- GROUP BY CUBE, ROLLUP: Null Values and GROUPING Function
- GROUPING_ID Function
- Partitioned Outer Joins