avg

This function is used to return the average value.

Syntax

avg(col), avg(DISTINCT col)

Parameters

Table 1 Parameter

Parameter

Mandatory

Type

Description

col

Yes

All data types

The value can be of any data type and can be converted to the DOUBLE type for calculation.

Return Values

The return value is of the DOUBLE type.

If the value of col is NULL, the column is not involved in calculation.

Example Code