Skip to content

VARIANCE

  • expr: This is the column or expression for which the variance is to be calculated. The `expr` must be a number type field.
SELECT VARIANCE(salary) FROM employees;
VARIANCE(SALARY)
----------------
1875.25

In the example, the function VARIANCE() is used to compute the statistical variance of all salaries in the employees table. The variance quantifies the spread of the salary data. The higher the variance, the wider the range of salaries in the company.