Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

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 | 

VARIANCE Function

Description

The VARIANCE function calculates the variance of a given expression using the following formula:

syntax_variance.gif

Syntax

VARIANCE( [DISTINCT | UNIQUE | ALL] expression )

  • expression : Specifies the expression to calculate the variance.
  • ALL : Gets the variance of all values (default).
  • DISTINCT or UNIQUE : Gets the variance of unique values without duplicates.
Example

The following is an example that returns the variance of the number of gold medals that Korea won.

SELECT VARIANCE(gold)
FROM participant
WHERE nation_code = 'KOR';

Result : 5