Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Functions : AVG


Computes the average of a collection of values. The keyword DISTINCT specifies that the duplicate values are to be eliminated before computing the average.


AVG ( {[ ALL ] expression }|{ DISTINCT column_ref} )


*NULL values are eliminated before the average value is computed. If all the values are NULL, the result is NULL.
*The argument to the function must be of type SMALLINT, INTEGER, NUMERIC, REAL, or FLOAT.
*The result is of type NUMERIC.


This example illustrates the AVG function:
SELECT AVG (salary)
FROM employee
WHERE deptno = 20 ;