VARIANCE
Syntax
Description
Returns the population standard variance of expr
. This is an extension to
standard SQL. The standard SQL function VAR_POP() can be used
instead.
Variance is calculated by
working out the mean for the set
for each number, subtracting the mean and squaring the result
calculate the average of the resulting differences
It is an aggregate function, and so can be used with the GROUP BY clause.
VARIANCE() can be used as a window function.
VARIANCE() returns NULL
if there were no matching rows.
Examples
As an aggregate function:
As a window function:
See Also
VAR_POP (equivalent, standard SQL)
STDDEV_POP (population standard deviation)
STDDEV_SAMP (sample standard deviation)
This page is licensed: GPLv2, originally from fill_help_tables.sql
Last updated
Was this helpful?