> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 其结果等于 varPop 的平方根。

# stddevPop

<div id="stddevPop">
  ## stddevPop
</div>

在 v1.1.0 中引入

返回数值数据序列的总体标准差。
结果等于 [`varPop`](/zh/reference/functions/aggregate-functions/varPop) 的平方根。

<Note>
  此函数使用的算法在数值上不稳定。如果计算需要[数值稳定性](https://en.wikipedia.org/wiki/Numerical_stability)，请改用 [`stddevPopStable`](/zh/reference/functions/aggregate-functions/stddevPopStable) 函数。该函数速度较慢，但计算误差更低。
</Note>

**语法**

```sql theme={null}
stddevPop(x)
```

**别名**: `STD`, `STDDEV_POP`

**参数**

* `x` — 要计算标准差的总体值。[`(U)Int*`](/zh/reference/data-types/int-uint) 或 [`Float*`](/zh/reference/data-types/float) 或 [`Decimal*`](/zh/reference/data-types/decimal)

**返回值**

返回 `x` 的总体方差的平方根。[`Float64`](/zh/reference/data-types/float)

**示例**

**计算总体标准差**

```sql title=Query theme={null}
CREATE TABLE test_data (population UInt8) ENGINE = Log;
INSERT INTO test_data VALUES (3),(3),(3),(4),(4),(5),(5),(7),(11),(15);

SELECT stddevPop(population) AS stddev FROM test_data;
```

```response title=Response theme={null}
┌────────────stddev─┐
│ 3.794733192202055 │
└───────────────────┘
```
