↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / Aggregate Functions

Computes the average (arithmetic mean) of all the non-null input values.

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

Signatures & examples

avg ( smallint ) → numeric
Computes the average (arithmetic mean) of all the non-null input values.
avg ( integer ) → numeric
Computes the average (arithmetic mean) of all the non-null input values.
avg ( bigint ) → numeric
Computes the average (arithmetic mean) of all the non-null input values.
avg ( numeric ) → numeric
Computes the average (arithmetic mean) of all the non-null input values.
avg ( real ) → double precision
Computes the average (arithmetic mean) of all the non-null input values.
avg ( double precision ) → double precision
Computes the average (arithmetic mean) of all the non-null input values.
avg ( interval ) → interval
Computes the average (arithmetic mean) of all the non-null input values.
Version history 4
  1. 12 → 13 changed
  2. 9.3 → 9.4 changed
  3. 8.3 → 8.4 changed
  4. 7.2 → 7.3 changed

Definition snapshot: b7bd9cda · English manual source