stddev_samp
Returns the sample standard deviation of an expression. Since v2.5.10, this function can also be used as a window function.
Syntaxβ
STDDEV_SAMP(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β
MySQL > select stddev_samp(scan_rows)
from log_statis
group by datetime;
+--------------------------+
| stddev_samp(`scan_rows`) |
+--------------------------+
| 2.372044195280762 |
+--------------------------+
See alsoβ
keywordβ
STDDEV_SAMP,STDDEV,SAMP