VAR_POP is an aggregate function that evaluates the population variance of an expression over a set of rows.

See Aggregates (set functions) for more information about these functions.

VAR_POP is allowed only on expressions that evaluate to numeric data types.

VAR_POP (expression)

The *expression* can contain multiple
column references or expressions, but it cannot contain another aggregate
or subquery. It must evaluate to a built-in numeric data type. If an expression
evaluates to NULL, the aggregate skips that value.

The resulting data type is DOUBLE (it might overflow).

Population variance is calculated as follows:

sum(x_{i}^{2})/n - m^{2}where n is the number of items in the population m is the population average x_{1}... x_{n}are the items in the population

-- find the variance in flight time per aircraft SELECT AIRCRAFT, VAR_POP( flying_time ) FROM flights GROUP BY aircraft;