# stddevSamp (/docs/reference/sql/aggregate-functions/stddevsamp)



This page describes the RawTree engine binary used to generate this reference. It does not define Query API support. Descriptions retain upstream ClickHouse terminology. See [SQL interface scope](/docs/reference/clickhouse-compatibility#service-interfaces).

Returns the sample standard deviation of a numeric data sequence.
The result is equal to the square root of [`varSamp`](/reference/functions/aggregate-functions/varSamp).

:::note
This function uses a numerically unstable algorithm.
If you need [numerical stability](https://en.wikipedia.org/wiki/Numerical_stability) in calculations, use the [`stddevSampStable`](/reference/functions/aggregate-functions/stddevSampStable) function. It works slower but provides a lower computational error.
:::

**Syntax**

```sql
stddevSamp(x)
```

**Arguments**

* `x` — Values for which to find the square root of sample variance. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal*`](/reference/data-types/decimal)

**Returned value**

Returns the square root of sample variance of `x`. [`Float64`](/reference/data-types/float)

**Examples**

**Computing sample standard deviation**

```sql title=Query
DROP TABLE IF EXISTS test_data;
CREATE TABLE test_data
(
    population UInt8,
)
ENGINE = Log;

INSERT INTO test_data VALUES (3),(3),(3),(4),(4),(5),(5),(7),(11),(15);

SELECT
    stddevSamp(population)
FROM test_data;
```

```text title=Response
┌─stddevSamp(population)─┐
│                      4 │
└────────────────────────┘
```

*Introduced in version 1.1.0.*
