Back to Starrocks

stddev,stddev_pop,std

docs/en/sql-reference/sql-functions/aggregate-functions/stddev.md

4.1.0959 B
Original Source

stddev,stddev_pop,std

Returns the population standard deviation of the expr expression. Since v2.5.10, this function can also be used as a window function.

Syntax

Haskell
STDDEV(expr)

Parameters

expr: the expression. If it is a table column, it must evaluate to TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, or DECIMAL.

Return value

Returns a DOUBLE value. The formula is as follows, where n represents the row count of the table:

Examples

plaintext
mysql> SELECT stddev(lo_quantity), stddev_pop(lo_quantity) from lineorder;
+---------------------+-------------------------+
| stddev(lo_quantity) | stddev_pop(lo_quantity) |
+---------------------+-------------------------+
|   14.43100708360797 |       14.43100708360797 |
+---------------------+-------------------------+

See also

stddev_samp

keyword

STDDEV,STDDEV_POP,POP