Hitachi

Hitachi Advanced Database SQL Reference


7.22.7 STDDEV_POP

STDDEV_POP determines the standard deviation of a population.

Organization of this subsection

(1) Specification format

general-set-function-STDDEV_POP ::= STDDEV_POP(value-expression)

(2) Explanation of specification format

value-expression:

Specifies the input values, in the form of a value expression, that make up the population whose standard deviation is to be determined. For details about value expressions, see 7.20 Value expression.

(3) Rules

  1. Null values are not included in the calculation.

  2. In the following cases, the execution result will be a null value.

    • If the number of input rows is 0

    • If the values to be calculated are all null values

  3. The execution result of the general set function STDDEV_POP will be equal to the square root of the general set function VAR_POP.

  4. The following table shows the data type that can be specified in the value expression and the data type of the execution result of the general set function STDDEV_POP.

    Table 7‒20: Data type that can be specified in the value expression and data type of the execution result of the general set function STDDEV_POP

    No.

    Data type that can be specified in the value expression

    Data type of the execution result of general set function STDDEV_POP

    1

    INTEGER

    DOUBLE PRECISION

    2

    SMALLINT

    3

    DECIMAL(m,n)

    4

    DOUBLE PRECISION

(4) Example

Example

Using the data in the salary table (SALARYLIST), this example determines the standard deviation of a population of employee salaries (SALARY).

SELECT STDDEV_POP("SALARY") AS "STDDEV_POP"
    FROM "SALARYLIST"

Example of execution results

[Figure]