Previous Topic: Arc TangentNext Topic: Capitalization


Average

The average function returns the average (mean) value of a specified group of numeric values, based upon changes in the resultant value of the GROUP BY clause.

Syntax:

►►─┬─ AVG ─────┬─ (value) ────────────────────────────────────────────────────►◄
   ├─ AVE ─────┤
   └─ AVERAGE ─┘

Invocation names:

AVG
AVE
AVERAGE

Parameters:

(value)

Specifies the numeric value or values whose average is being calculated.

Example:

This example determines the average salary for each department. The total salary for the employees in DEPT1 = 100000. The number of employees in DEPT1 = 6.

compute ave-sal = ave(salary) group by department

     AVE-SAL = 16666.66