8th November 2018: PostgreSQL 11.1, 10.6, 9.6.11, 9.5.15, 9.4.20, and 9.3.25 Released!

Development Versions:
devel

Author:Written by Isaac Wilcox`<isaac@azartmedia.com>`

on 2000-06-16

*Aggregate functions* compute a single
result value from a set of input values. The special syntax
considerations for aggregate functions are explained in Section 1.3.5.
Consult the *PostgreSQL Tutorial* for
additional introductory information.

Table 4-30. Aggregate Functions

It should be noted that except for `COUNT`

, these functions return NULL when no rows
are selected. In particular, `SUM`

of
no rows returns NULL, not zero as one might expect. `COALESCE`

may be used to substitute zero for
NULL when necessary.