# Statistical Functions

#### <mark style="color:purple;">STDDEV(</mark>  expression  <mark style="color:purple;">)</mark>

Returns the sample standard deviation, within the input group of values.

```sql
select stddev(colB) from table1
```

#### <mark style="color:purple;">STDDEV\_POP(</mark>  expression  <mark style="color:purple;">)</mark>

Returns the population standard deviation, which is the square root of the population variance, from the input group of values.

```sql
select stddev_pop(colB) from table1
```

#### <mark style="color:purple;">PERCENTILE\_CONT(</mark> \<percentile> ) WITHIN GROUP (ORDER BY \<expression> \[ ASC | DESC ] <mark style="color:purple;">)</mark>

Returns the linear interpolated value that would fall into the given **\<percentile>** value with respect to the specified sort direction.

```sql
select percentile_cont(0.5) within group1 (order by colA asc) from table1
```

#### <mark style="color:purple;">APPROX\_QUANTILES(</mark>  \<expr>,   number  <mark style="color:purple;">)</mark>

```sql
select approx_quantiles(colA, 4)
```

Returns the approximate boundaries for a group of `<expr>`values, where `number` represents the number of quantiles to create. This function returns an array of `number` + 1 element, where the first element is the approximate minimum and the last element is the approximate maximum.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.e6data.com/product-documentation/sql-command-reference/statistical-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
