↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Aggregate Functions

Computes the sum of the non-null input values.

Reading PG 18current·documented in 27 of 27 versions, 7.1 to 20

Signatures & examples

sum ( smallint ) → bigint
Computes the sum of the non-null input values.
sum ( integer ) → bigint
Computes the sum of the non-null input values.
sum ( bigint ) → numeric
Computes the sum of the non-null input values.
sum ( numeric ) → numeric
Computes the sum of the non-null input values.
sum ( real ) → real
Computes the sum of the non-null input values.
sum ( double precision ) → double precision
Computes the sum of the non-null input values.
sum ( interval ) → interval
Computes the sum of the non-null input values.
sum ( money ) → money
Computes the sum of the non-null input values.
Version history 6
  1. 12 → 13 changed
  2. 9.3 → 9.4 changed
  3. 8.4 → 9.0 changed
  4. 8.0 → 8.1 changed
  5. 7.2 → 7.3 changed
  6. 7.1 → 7.2 changed

Definition snapshot: b7bd9cda · English manual source