## EDB Postgres Cloud Database Service

A complete managed service, delivering enterprise-ready EDB Postgres databases on the Amazon Web Services (AWS) Cloud.

Take advantage of our full-featured trial today — no credit card required.

Already have an account? Log in

3 The SQL Language : 3.5 Functions and Operators : 3.5.11 Aggregate Functions

3.5.11 Aggregate FunctionsAggregate functions compute a single result value from a set of input values. The built-in aggregate functions are listed in the following tables.

NUMBER for any integer type, DOUBLE PRECISION for a floating-point argument, otherwise the same as the argument data type BIGINT for SMALLINT or INTEGER arguments, NUMBER for BIGINT arguments, DOUBLE PRECISION for floating-point arguments, otherwise the same as the argument data type 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.The following table shows the aggregate functions typically used in statistical analysis. (These are separated out merely to avoid cluttering the listing of more-commonly-used aggregates.) Where the description mentions N, it means the number of input rows for which all the input expressions are non-null. In all cases, null is returned if the computation is meaningless, for example when N is zero.

Historic alias for STDDEV_SAMP Historical alias for VAR_SAMP

3 The SQL Language : 3.5 Functions and Operators : 3.5.11 Aggregate Functions