NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
A-72
Examples—AVG
Examples—AVG
The following SELECT statement returns the average salary from the SALARY
column of the PERSNL.EMPLOYEE table:
>> SELECT AVG (SALARY) FROM PERSNL.EMPLOYEE;
(EXPR)
---------------------
48784.65
--- 1 row(s) selected.
The following SELECT statement returns the average unique salary from the
SALARY column of the PERSNL.EMPLOYEE table:
>> SELECT AVG (DISTINCT SALARY) FROM PERSNL.EMPLOYEE;
(EXPR)
---------------------
52664.21
--- 1 row(s) selected.