Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 



STDDEV/STDDEV_POP Functions

Description

The STDDEV function returns a standard deviation of the expression values of all rows. Only one expression is specified as a parameter. You can get the standard deviation without duplicates by inserting the DISTINCT or UNIQUE keyword in front of the expression, or get the standard deviation 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.

Syntaxs

STDDEV( [ { DISTINCT | DISTINCTROW } | UNIQUE | ALL] expression )

  • expression : Specifies an expression that returns a numeric value.
  • ALL : Calculates the standard deviation for all data (default).
  • DISTINCT or UNIQUE : Calculates the standard deviation without duplicates.
Example

CREATE TABLE test_table (d DOUBLE);

INSERT INTO test_table VALUES(78), (63.65), (230.54), (32), (17.2), (195.7689), (57.57);

 

SELECT STDDEV_POP(d) FROM test_table;

             stddev_pop(d)

==========================

    7.672456168942171e+01

 

SELECT STDDEV_POP(POWER(d,2)+d*2+1) FROM test_table;

  stddev_pop( power(d, 2)+d*2+1)

================================

          1.995964904967644e+04

 

TRUNCATE TABLE test_table;

SELECT STDDEV_POP(d) FROM test_table;

                stddev_pop(d)

==========================

                      NULL