.-ALL------. >>-+-VARIANCE-+--(----+----------+--expression--)-------------->< '-VAR------' '-DISTINCT-'
The schema is SYSIBM.
The VARIANCE function returns the variance of a set of numbers.
The argument values must be numbers.
The data type of the result is double-precision floating point. The result can be null.
The function is applied to the set of values derived from the argument values by the elimination of null values. If DISTINCT is specified, duplicate values are eliminated.
If the function is applied to an empty set, the result is a null value. Otherwise, the result is the variance of the values in the set.
The order in which the values are added is undefined, but every intermediate result must be within the range of the result data type.
Example:
SELECT VARIANCE(SALARY) INTO :VARNCE FROM EMPLOYEE WHERE WORKDEPT = 'A00'
Results in VARNCE being set to approximately 98763888.88 when using the sample table.