Skip to main content

STDDEV

Returns the standard deviation of all the values in a specified expression.

Syntax

STDDEV( [ DISTINCT ] <expression> )

Arguments

  • expression: numeric expression

Return Type

Returns the standard deviation of the expression or NULL if there are no matching rows.

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 STDDEV(z_axis) FROM coordinates;

****
+---------------+
| STDDEV(z_axis)|
+---------------+
| 5.083306      |
+---------------+