Previous Topic: List of Aggregate FunctionsNext Topic: COUNT Function


AVG Function

The AVG function returns the average of all values in a specified column. For example, to obtain the average cost of all workstations in the table named WORKSTATIONS, you could use the following statement:

OPSQL SELECT AVG (COST) FROM WORKSTATIONS

This function would yield a result of 3350.

The AVG function is limited to use on numeric data types only.