Avg function

Updated at:

avg returns the average of all values in a column.

Syntax

avg(column)

Arguments

ArgumentTypeDescription
column—The column to average.

Return value

Returns the arithmetic mean of all values in the column.

Examples

Calculate the average of all values in the c1 column of the test table:

SELECT avg(c1) FROM test;