General-Purpose Aggregate
Functions
Example query
It should be noted that except for
count
, these functions return a null value when
no rows are selected. In particular, sum
of no rows returns null, not zero as one
might expect. The coalesce
function
may be used to substitute zero for null when necessary.
Aggregate Functions for
Statistics