﻿---
title: ES|QL STD_DEV function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2848/reference/query-languages/esql/functions-operators/aggregation-functions/std_dev
products:
  - Elasticsearch
---

# ES|QL STD_DEV function
## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/2848/reference/query-languages/esql/images/functions/std_dev.svg)


## Parameters

<definitions>
  <definition term="number">
  </definition>
</definitions>


## Description

The population standard deviation of a numeric field.

## Supported types


| number  | result |
|---------|--------|
| double  | double |
| integer | double |
| long    | double |


## Examples

```esql
FROM employees
| STATS std_dev_height = STD_DEV(height)
```


| std_dev_height:double |
|-----------------------|
| 0.2063704             |

The expression can use inline functions. For example, to calculate the population standard deviation of each employee’s maximum salary changes, first use `MV_MAX` on each row, and then use `STD_DEV` on the result
```esql
FROM employees
| STATS stddev_salary_change = STD_DEV(MV_MAX(salary_change))
```


| stddev_salary_change:double |
|-----------------------------|
| 6.87583                     |