Skip to main content

STDDEV_POP

Aggregate function. Returns the population standard deviation for non-NULL values.

Syntax

STDDEV_POP ( [ DISTINCT ] <expression> )

Arguments

  • expression: numeric, uses standard deviation for calculating .

Return Type

A double.

Examples

The following table and values were used for the examples:

CREATE TABLE coordinates(
x_axis decimal (5,2),
y_axis decimal (7,2),
z_axis decimal (10,2));

INSERT INTO coordinates VALUES (2, 5, 9), 
(7, 15, null), 
(8, 1, 12), 
(5, 7, 0), 
(8, 6, 1), 
(null, 7, 11);
SELECT x_axis, STDDEV_POP(z_axis), STDDEV_POP(y_axis) 
FROM coordinates GROUP BY x_axis;

****
+--------+-------------------+--------------------+
| x_axis | STDDEV_POP(z_axis)| STDDEV_POP(y_axis) |
+--------+-------------------+--------------------+
| 5.00   | 0.000000          | 0.000000           |
| 2.00   | 0.000000          | 0.000000           |
| NULL   | 0.000000          | 0.000000           |
| 8.00   | 5.500000          | 2.500000           |
| 7.00   | NULL              | 0.000000           |
+--------+-------------------+--------------------+