Versions available for this page: CUBRID 8.2.1 | CUBRID 8.3.0 | CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 | CUBRID 8.4.3 | CUBRID 9.0.0 |
The VARIANCE function returns a variance of expression values of all rows. Only one expression is specified as a parameter. You can get the variance without duplicates by using the DISTINCT or UNIQUE keyword in front of the expression or the variance of all values by omitting the keyword or by using ALL.
The return value may be different from the actual evaluation value because it follows the type of the expression specified as a parameter.
The following is a formula that is applied to the function.

VARIANCE( [DISTINCT | UNIQUE | ALL] expression )
The following is an example that returns the variance of the number of gold medals Korea won from 1988 to 2004 in the Olympics. (demodb)
SELECT VARIANCE(gold), VARIANCE(CAST (gold AS FLOAT)) FROM participant
WHERE nation_code = 'KOR';
=== <Result of SELECT Command in Line 1> ===
variance(gold) variance( cast(gold as float))
================================================
5 5.299995e+000