> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# stddev_samp

> Returns the sample standard deviation of an expression.

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

## Syntax

```Haskell theme={null}
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:

![image](https://mintcdn.com/mirrorship-docs/sL46GVQByWEibCzI/documents/images/65a2c76b5a6aeda42adb39ee.png?fit=max\&auto=format\&n=sL46GVQByWEibCzI\&q=85\&s=553fd015429eabad522362ec9ecf06b1)

## Examples

```plain text theme={null}
MySQL > select stddev_samp(scan_rows)
from log_statis
group by datetime;
+--------------------------+
| stddev_samp(`scan_rows`) |
+--------------------------+
|        2.372044195280762 |
+--------------------------+
```

## See also

[stddev](/documents/4.2/sql-reference/sql-functions/aggregate-functions/stddev.md)

## keyword

STDDEV\_SAMP,STDDEV,SAMP


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.