VAR_POP
Description
The VAR_POP function is used to calculate the population variance of a set of numerical data. Variance is a statistical measure of the dispersion of data distribution, used to reflect the degree of volatility in the data. By calculating the population variance, we can understand the data's volatility, allowing for a deeper analysis of the data.
Parameter Description
-
expr
: Numerical type, can be tinyint, smallint, int, bigint, float, double, or decimal type.DISTINCT
: Optional parameter, indicating the calculation of the variance of the set after deduplication. If this parameter is not set, the variance of the set including duplicate values is calculated.
Return Result
- The return type is double.
- If all input values are null, null is returned.
Usage Example
- Calculate the variance of the set including duplicate values:
- Calculate the variance of the deduplicated set: