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

# STDDEV_POP

> Returns population standard deviation.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Aggregate · Window</span></div>

NULL values are ignored. No values yields NULL; one value yields zero.

## Syntax

A window function keeps each input row and adds a result for that row. `PARTITION BY` groups rows with matching values; without it, all input rows form one group.

### Aggregate

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
stddev_pop(value)
```

### Window

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
stddev_pop(value) OVER ([PARTITION BY key] [ORDER BY ordering_key] [ROWS frame])
```

## Arguments

### Aggregate and window

| Name | Type | Required | Description |
| - | - | - | - |
| value | TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE or DECIMAL(p, s) | Yes | Non-NULL numeric inputs. For DECIMAL(p, s), p is precision (total digits) and s is scale (digits after the decimal point). |

## Returns

* Type: DOUBLE
* NULL behavior: NULL values are ignored. No values yields NULL; one value yields zero.
* Empty input: Returns NULL on empty input.

## Properties

| Property | Value |
| - | - |
| Deterministic | Partial (Floating-point results can differ slightly because of rounding.) |
| Supports DISTINCT | No |
| Supports window usage | Partial (ROWS frames are supported. DISTINCT and RANGE offsets are not supported.) |
| Supports window frames | Partial (RANGE offsets are not supported; ROWS restrictions vary by form. See Usage notes.) |
| Exact result | Partial (Floating-point arithmetic can round.) |

## Usage notes

* Returns DOUBLE. Sample statistics divide by n − 1; population statistics divide by n, where n is the number of included values.
* INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
* DISTINCT is not supported for this standard-deviation function.

## Examples

### Population standard deviation

For the population values 0 and 2, the mean is 1 and the population standard deviation is 1.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
WITH t(v) AS (VALUES (0.0), (2.0)) SELECT stddev_pop(v) AS result FROM t;
```

| result |
| - |
| 1.0 |

### Groups with different numbers of values

NULL values are excluded from the calculation. Results are rounded to six decimal places where needed.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
WITH sample(grp, v) AS (VALUES (1, 1), (1, 5), (2, 8), (2, CAST(NULL AS INT)))
SELECT grp, round(stddev_pop(CAST(v AS DOUBLE)), 6) AS result
FROM sample GROUP BY grp ORDER BY grp;
```

| grp | result |
| - | - |
| 1 | 2 |
| 2 | 0 |

## Limitations

* The result is DOUBLE. Query tools may report the input’s floating-point or decimal type, but that does not change the returned value’s type.
* STDDEV\_POP does not accept DISTINCT. To calculate over unique values, remove duplicates in a subquery first.


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