

# Statistical list aggregate functions

Use these functions to compute statistics over the elements of one list, such as the median, the mode, the variance, or the standard deviation. Functions whose names end in `_pop` treat the list as a whole population, and functions whose names end in `_samp` treat it as a sample.

## `list_entropy` function
<a name="athena-duckdb-functions-list-list-entropy"></a>

Treats the non-`NULL` elements of `list` as a sample and returns the Shannon entropy of how often each distinct value occurs, computed with base-2 logarithms. The result is `0` when every element has the same value, and it grows as the values become more varied and more evenly spread. For `n` distinct values that each occur equally often, the result is the base-2 logarithm of `n`.

`NULL` elements are ignored. If `list` is `NULL`, the result is `NULL`. `list_entropy({{list}})` returns the same result as `list_aggregate({{list}}, 'entropy')`.

### Syntax
<a name="athena-duckdb-functions-list-list-entropy-syntax"></a>

```sql
list_entropy({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-entropy-arguments"></a>

The `list_entropy` function takes the following argument:

**{{list}}**  
The list whose entropy you want, such as an `INTEGER[]` or `VARCHAR[]` value. Its elements must be values that can be compared for equality.

### Return type
<a name="athena-duckdb-functions-list-list-entropy-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-entropy-examples"></a>

The following SQL query returns the entropy of a list in which one value occurs twice and another occurs once.

```sql
SELECT list_entropy([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.9182958340544893` | 

The following SQL query compares a list of four different values, which has an entropy of 2 bits, with a list in which every value is the same.

```sql
SELECT
    list_entropy([1, 2, 3, 4]) AS four_values,
    list_entropy(['x', 'x', 'x']) AS one_value
```

The query returns the following result.


| four\_values | one\_value | 
| --- | --- | 
| `2.0` | `0.0` | 

The following SQL query shows that an empty list returns `0`.

```sql
SELECT list_entropy(CAST([] AS INTEGER[])) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.0` | 

### Considerations
<a name="athena-duckdb-functions-list-list-entropy-considerations"></a>

An empty list, or a list that holds only `NULL` elements, returns `0`, not `NULL`.

## `list_kurtosis` function
<a name="athena-duckdb-functions-list-list-kurtosis"></a>

Returns the sample excess kurtosis of the elements of `list` that are not `NULL`. Kurtosis measures how heavy the tails of a distribution are. Excess kurtosis subtracts `3`, so a normal distribution scores `0`, a distribution with more extreme outliers scores higher, and a distribution with fewer scores lower. The sample form treats the elements as a sample drawn from a larger set of values, and it applies a correction for the number of elements.

The function needs at least four elements that are not `NULL`. With fewer elements, or when every element has the same value, the result is `NULL`.

`list_kurtosis({{list}})` returns the same result as `list_aggregate({{list}}, 'kurtosis')`. To compute the kurtosis of the elements as a whole population, without the correction, use the [`list_kurtosis_pop` function](#athena-duckdb-functions-list-list-kurtosis-pop). To compute kurtosis across rows, use the `kurtosis` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-kurtosis-syntax"></a>

```sql
list_kurtosis({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-kurtosis-arguments"></a>

The `list_kurtosis` function takes the following argument:

**{{list}}**  
The list of numbers whose sample excess kurtosis you want. The elements are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-list-list-kurtosis-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-kurtosis-examples"></a>

The following SQL query returns the sample excess kurtosis of four numbers.

```sql
SELECT list_kurtosis([1, 2, 2, 3]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.5` | 

The following SQL query shows that a `NULL` element is ignored, so the result is the same as for the four other numbers.

```sql
SELECT list_kurtosis([1, 2, 2, 3, NULL]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.5` | 

The following SQL query returns `NULL` because the list has only three elements.

```sql
SELECT list_kurtosis([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `NULL` | 

## `list_kurtosis_pop` function
<a name="athena-duckdb-functions-list-list-kurtosis-pop"></a>

Returns the excess kurtosis of the elements of `list` that are not `NULL`, treating them as a whole population. Unlike `list_kurtosis`, the function makes no correction for the sample size. Excess kurtosis subtracts `3`, so a normal distribution scores `0`.

The function needs at least two elements that are not `NULL`. With fewer elements, or when every element has the same value, the result is `NULL`.

`list_kurtosis_pop({{list}})` returns the same result as `list_aggregate({{list}}, 'kurtosis_pop')`. To compute it across rows, use the `kurtosis_pop` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-kurtosis-pop-syntax"></a>

```sql
list_kurtosis_pop({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-kurtosis-pop-arguments"></a>

The `list_kurtosis_pop` function takes the following argument:

**{{list}}**  
The list of numbers whose population excess kurtosis you want. The elements are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-list-list-kurtosis-pop-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-kurtosis-pop-examples"></a>

The following SQL query returns the population excess kurtosis of three numbers.

```sql
SELECT list_kurtosis_pop([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `-1.5` | 

The following SQL query compares the population and sample results for the same four numbers.

```sql
SELECT
    list_kurtosis_pop([1, 2, 2, 3]) AS population,
    list_kurtosis([1, 2, 2, 3]) AS sample
```

The query returns the following result.


| population | sample | 
| --- | --- | 
| `-1.0` | `1.5` | 

The following SQL query returns `NULL` because every element has the same value.

```sql
SELECT list_kurtosis_pop([5, 5, 5]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `NULL` | 

## `list_mad` function
<a name="athena-duckdb-functions-list-list-mad"></a>

Returns the median absolute deviation (MAD) of the elements of `list`: the median of the absolute differences between each element and the median of all the elements. Like the standard deviation, it measures how spread out the values are, but a few extreme values change it much less.

`NULL` elements are ignored. If `list` is empty, holds only `NULL` elements, or is `NULL`, the result is `NULL`. For a list of date or time values, the result is an `INTERVAL`.

`list_mad({{list}})` returns the same result as `list_aggregate({{list}}, 'mad')`. To compute it across rows, use the `mad` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-mad-syntax"></a>

```sql
list_mad({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-mad-arguments"></a>

The `list_mad` function takes the following argument:

**{{list}}**  
The values whose median absolute deviation you want, as a list of numbers, or of `DATE`, `TIME`, `TIME WITH TIME ZONE`, `TIMESTAMP`, or `TIMESTAMP WITH TIME ZONE` values.

### Return type
<a name="athena-duckdb-functions-list-list-mad-return-type"></a>

`DOUBLE` for a list of integers or `DOUBLE` values, the element type for a list of `FLOAT` or `DECIMAL` values, and `INTERVAL` for a list of date or time values.

### Examples
<a name="athena-duckdb-functions-list-list-mad-examples"></a>

The following SQL query returns the median absolute deviation of three numbers. The median is `3`, the absolute differences from it are `0`, `0`, and `6`, and the median of those differences is `0`.

```sql
SELECT list_mad([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.0` | 

The following SQL query shows that one extreme value, `100`, has little effect on the result.

```sql
SELECT list_mad([1, 2, 3, 4, 100]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.0` | 

The following SQL query returns the median absolute deviation of three dates, as an `INTERVAL`.

```sql
SELECT
    list_mad(
        [
            DATE '2026-10-01', DATE '2026-10-03',
            DATE '2026-10-10'
        ]
    ) AS result
```

The query returns the following result.


| result | 
| --- | 
| `2 days` | 

## `list_median` function
<a name="athena-duckdb-functions-list-list-median"></a>

Returns the median of the elements of `list` that are not `NULL`: the value in the middle when the elements are sorted. When there is an even number of elements, the result for numbers, dates, times, and intervals is the average of the two middle values. For other types, such as `VARCHAR`, it is the smaller of the two middle values.

If `list` is empty, holds only `NULL` elements, or is `NULL`, the result is `NULL`.

`list_median({{list}})` returns the same result as `list_aggregate({{list}}, 'median')`. To compute the median across rows, use the `median` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-median-syntax"></a>

```sql
list_median({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-median-arguments"></a>

The `list_median` function takes the following argument:

**{{list}}**  
The list whose median you want, with elements of any type that can be ordered.

### Return type
<a name="athena-duckdb-functions-list-list-median-return-type"></a>

`DOUBLE` for a list of integers, `TIMESTAMP` for a list of `DATE` values, and the element type for other lists, including `DECIMAL` and `VARCHAR` lists.

### Examples
<a name="athena-duckdb-functions-list-list-median-examples"></a>

The following SQL query returns the median of three integers.

```sql
SELECT list_median([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `3.0` | 

The following SQL query returns the median of four integers and the median of four strings. For the integers, the median is the average of the two middle values. For the strings, it is the smaller of the two middle strings.

```sql
SELECT
    list_median([1, 2, 3, 4]) AS median_number,
    list_median(['b', 'a', 'c', 'd']) AS median_string
```

The query returns the following result.


| median\_number | median\_string | 
| --- | --- | 
| `2.5` | `b` | 

The following SQL query returns the median of two dates. The average falls at noon, so the result is a `TIMESTAMP`.

```sql
SELECT
    list_median(
        [DATE '2026-10-01', DATE '2026-10-04']
    ) AS result
```

The query returns the following result.


| result | 
| --- | 
| `2026-10-02 12:00:00` | 

The following SQL query shows that the median of two `DECIMAL(2,1)` values keeps one decimal place and drops the rest. Cast the list to `DOUBLE[]` to get the exact average.

```sql
SELECT
    list_median([1.0, 2.5]) AS decimal_result,
    list_median(
        CAST([1.0, 2.5] AS DOUBLE[])
    ) AS double_result
```

The query returns the following result.


| decimal\_result | double\_result | 
| --- | --- | 
| `1.7` | `1.75` | 

### Considerations
<a name="athena-duckdb-functions-list-list-median-considerations"></a>

For a list of `DATE` values, the result is a `TIMESTAMP`, because the average of two dates can fall in the middle of a day.

For a list of `DECIMAL` values, the result has the same scale as the elements, and the digits past that scale are dropped, not rounded. For example, `list_median([1.0, 2.5])` returns `1.7`, not `1.75`. To keep those digits, cast the list to `DOUBLE[]` first.

## `list_mode` function
<a name="athena-duckdb-functions-list-list-mode"></a>

Returns the element of `list` that occurs most often. `NULL` elements are not counted, even when `NULL` occurs more often than any other element. If `list` is empty, holds only `NULL` elements, or is `NULL`, the result is `NULL`.

When two or more elements tie for the highest count, the result is the one that occurs first in the list.

`list_mode({{list}})` returns the same result as `list_aggregate({{list}}, 'mode')`. To find the most frequent value across rows, use the `mode` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-mode-syntax"></a>

```sql
list_mode({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-mode-arguments"></a>

The `list_mode` function takes the following argument:

**{{list}}**  
The list whose most frequent element you want, with elements of any type.

### Return type
<a name="athena-duckdb-functions-list-list-mode-return-type"></a>

The element type of `list`, for example `INTEGER` for an `INTEGER[]` list.

### Examples
<a name="athena-duckdb-functions-list-list-mode-examples"></a>

The following SQL query returns the most frequent element of a list.

```sql
SELECT list_mode([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `3` | 

The following SQL query shows that `NULL` elements are not counted, even though `NULL` occurs most often.

```sql
SELECT list_mode([NULL, NULL, 4]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `4` | 

The following SQL query shows how a tie is decided. In both lists, `1` and `2` each occur twice, so the result is the element that occurs first.

```sql
SELECT
    list_mode([2, 1, 1, 2]) AS starts_with_2,
    list_mode([1, 2, 2, 1]) AS starts_with_1
```

The query returns the following result.


| starts\_with\_2 | starts\_with\_1 | 
| --- | --- | 
| `2` | `1` | 

## `list_sem` function
<a name="athena-duckdb-functions-list-list-sem"></a>

Returns the standard error of the mean of the elements of `list`, computed as their population standard deviation divided by the square root of the number of elements. The result equals `list_stddev_pop({{list}}) / sqrt({{n}})`, where `n` is the number of elements that are not `NULL`.

`NULL` elements are ignored. With one element, the result is `0.0`. If the list is empty, contains only `NULL` elements, or is `NULL`, the result is `NULL`.

`list_sem({{list}})` returns the same result as `list_aggregate({{list}}, 'sem')`. To compute the value across rows, use the `sem` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-sem-syntax"></a>

```sql
list_sem({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-sem-arguments"></a>

The `list_sem` function takes the following argument:

**{{list}}**  
The list of numeric values whose standard error of the mean you want. The values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-list-list-sem-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-sem-examples"></a>

The following SQL query returns the standard error of the mean of three values.

```sql
SELECT list_sem([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.6329931618554523` | 

The following SQL query shows that the result equals the population standard deviation divided by the square root of the number of elements.

```sql
SELECT
    list_sem([3, 3, 9]) = list_stddev_pop([3, 3, 9]) / sqrt(3) AS is_equal
```

The query returns the following result.


| is\_equal | 
| --- | 
| `true` | 

The following SQL query passes a list with one element, so the result is `0.0`.

```sql
SELECT list_sem([5]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `0.0` | 

### Considerations
<a name="athena-duckdb-functions-list-list-sem-considerations"></a>

`list_sem` uses the population standard deviation. Some statistics tools compute the standard error with the sample standard deviation instead, which gives a larger value. For example, for `[3, 3, 9]`, `list_sem` returns about `1.633`, and `list_stddev_samp([3, 3, 9]) / sqrt(3)` returns `2.0`.

## `list_skewness` function
<a name="athena-duckdb-functions-list-list-skewness"></a>

Returns the sample skewness of the elements of `list`, adjusted for the number of elements (the adjusted Fisher-Pearson coefficient of skewness). The value measures how asymmetric the distribution of the elements is. A positive result means a longer tail of large values, and a negative result means a longer tail of small values.

`NULL` elements are ignored. If the list has fewer than three elements that are not `NULL`, or if all of those elements are equal, the result is `NULL`.

`list_skewness({{list}})` returns the same result as `list_aggregate({{list}}, 'skewness')`. To compute the value across rows, use the `skewness` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-skewness-syntax"></a>

```sql
list_skewness({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-skewness-arguments"></a>

The `list_skewness` function takes the following argument:

**{{list}}**  
The list of numeric values whose skewness you want. The values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-list-list-skewness-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-skewness-examples"></a>

The following SQL query has one value that is larger than the others, so the skewness is positive.

```sql
SELECT list_skewness([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `1.7320508075688772` | 

The following SQL query returns the skewness of four values.

```sql
SELECT list_skewness([1, 1, 1, 5]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `2.0` | 

The following SQL query passes only two elements, so the result is `NULL`.

```sql
SELECT list_skewness([1, 2]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `NULL` | 

### Differences from Athena engine version 3
<a name="athena-duckdb-functions-list-list-skewness-differences-from-engine-version-3"></a>

Athena engine version 3 has no `list_skewness` function, and its `skewness` aggregate function does not adjust the result for the number of values. For the values `1`, `1`, `1`, and `5`, the `skewness` aggregate in Athena engine version 3 returns about `1.1547`, and `list_skewness([1, 1, 1, 5])` returns `2.0`. To get the Athena engine version 3 value, multiply the result by `(n - 2) / sqrt(n * (n - 1))`, where `n` is the number of elements that are not `NULL`.

## `list_stddev_pop` function
<a name="athena-duckdb-functions-list-list-stddev-pop"></a>

Returns the population standard deviation of the elements of `list`. It treats the elements as the whole population, so it divides the sum of squared deviations from the mean by the number of elements. To treat the elements as a sample of a larger population, use the [`list_stddev_samp` function](#athena-duckdb-functions-list-list-stddev-samp).

`NULL` elements are ignored. With one element, the result is `0.0`. If the list is empty, contains only `NULL` elements, or is `NULL`, the result is `NULL`.

`list_stddev_pop({{list}})` returns the same result as `list_aggregate({{list}}, 'stddev_pop')`. To compute the value across rows, use the `stddev_pop` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-stddev-pop-syntax"></a>

```sql
list_stddev_pop({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-stddev-pop-arguments"></a>

The `list_stddev_pop` function takes the following argument:

**{{list}}**  
The list of numeric values whose population standard deviation you want. The values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-list-list-stddev-pop-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-stddev-pop-examples"></a>

The following SQL query returns the population standard deviation of three values.

```sql
SELECT list_stddev_pop([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `2.8284271247461903` | 

The following SQL query returns the population standard deviation of eight values, whose mean is 5.

```sql
SELECT
    list_stddev_pop([2, 4, 4, 4, 5, 5, 7, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `2.0` | 

The following SQL query ignores the `NULL` element and uses the other two values.

```sql
SELECT list_stddev_pop([3, NULL, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `3.0` | 

## `list_stddev_samp` function
<a name="athena-duckdb-functions-list-list-stddev-samp"></a>

Returns the sample standard deviation of the elements of `list`. It treats the elements as a sample of a larger population, so it divides the sum of squared deviations from the mean by one less than the number of elements. To treat the elements as the whole population, use the [`list_stddev_pop` function](#athena-duckdb-functions-list-list-stddev-pop).

`NULL` elements are ignored. If the list has fewer than two elements that are not `NULL`, or if the list is `NULL`, the result is `NULL`.

`list_stddev_samp({{list}})` returns the same result as `list_aggregate({{list}}, 'stddev_samp')`. To compute the value across rows, use the `stddev_samp` aggregate function.

### Syntax
<a name="athena-duckdb-functions-list-list-stddev-samp-syntax"></a>

```sql
list_stddev_samp({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-stddev-samp-arguments"></a>

The `list_stddev_samp` function takes the following argument:

**{{list}}**  
The list of numeric values whose sample standard deviation you want. The values are converted to `DOUBLE`.

### Return type
<a name="athena-duckdb-functions-list-list-stddev-samp-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-stddev-samp-examples"></a>

The following SQL query returns the sample standard deviation of three values.

```sql
SELECT list_stddev_samp([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `3.4641016151377544` | 

The following SQL query returns the sample standard deviation of eight values, whose mean is 5.

```sql
SELECT
    list_stddev_samp([2, 4, 4, 4, 5, 5, 7, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `2.138089935299395` | 

The following SQL query passes a list with one element, so the result is `NULL`.

```sql
SELECT list_stddev_samp([5]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `NULL` | 

## `list_var_pop` function
<a name="athena-duckdb-functions-list-list-var-pop"></a>

Returns the population variance of the elements of `list` that are not `NULL`: the average of the squared differences between each element and the mean of the elements. The function divides by the number of elements, `n`, so for a list with one element, the result is `0`.

`NULL` elements are skipped. If `list` is empty, holds only `NULL` elements, or is itself `NULL`, the result is `NULL`. `list_var_pop({{list}})` returns the same result as `list_aggregate({{list}}, 'var_pop')`. To estimate the variance of a larger population from a sample, use the [`list_var_samp` function](#athena-duckdb-functions-list-list-var-samp).

### Syntax
<a name="athena-duckdb-functions-list-list-var-pop-syntax"></a>

```sql
list_var_pop({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-var-pop-arguments"></a>

The `list_var_pop` function takes the following argument:

**{{list}}**  
The numbers whose population variance you want, as a `LIST`. The elements are converted to `DOUBLE` for the computation.

### Return type
<a name="athena-duckdb-functions-list-list-var-pop-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-var-pop-examples"></a>

The following SQL query returns the population variance of three numbers, whose mean is 5.

```sql
SELECT list_var_pop([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `8.0` | 

The following SQL query returns the population variance of the list `[3, NULL, 3, 9]`. The `NULL` element is skipped, so the result is `8.0`, the same as for `[3, 3, 9]`.

```sql
SELECT list_var_pop([3, NULL, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `8.0` | 

The following SQL query shows that the population variance is `0.0` for a list with one element and `NULL` for an empty list.

```sql
SELECT
    list_var_pop([5]) AS one_element,
    list_var_pop([]) IS NULL AS empty_is_null
```

The query returns the following result.


| one\_element | empty\_is\_null | 
| --- | --- | 
| `0.0` | `true` | 

## `list_var_samp` function
<a name="athena-duckdb-functions-list-list-var-samp"></a>

Returns the sample variance of the elements of `list` that are not `NULL`. The sample variance is the sum of the squared differences between each element and the mean, divided by the number of elements minus 1 (`n - 1`). Use it to estimate the variance of a population from a sample of its values.

`NULL` elements are skipped. If fewer than two elements are not `NULL`, the result is `NULL`, so a list with one element returns `NULL`, not `0`. `list_var_samp({{list}})` returns the same result as `list_aggregate({{list}}, 'var_samp')`. For the population variance, use the [`list_var_pop` function](#athena-duckdb-functions-list-list-var-pop).

### Syntax
<a name="athena-duckdb-functions-list-list-var-samp-syntax"></a>

```sql
list_var_samp({{list}})
```

### Arguments
<a name="athena-duckdb-functions-list-list-var-samp-arguments"></a>

The `list_var_samp` function takes the following argument:

**{{list}}**  
The numbers whose sample variance you want, as a `LIST`. The elements are converted to `DOUBLE` for the computation.

### Return type
<a name="athena-duckdb-functions-list-list-var-samp-return-type"></a>

`DOUBLE`

### Examples
<a name="athena-duckdb-functions-list-list-var-samp-examples"></a>

The following SQL query returns the sample variance of three numbers.

```sql
SELECT list_var_samp([3, 3, 9]) AS result
```

The query returns the following result.


| result | 
| --- | 
| `12.0` | 

The following SQL query compares the population variance and the sample variance of the same list.

```sql
SELECT
    list_var_pop([1, 2, 3, 4]) AS population,
    list_var_samp([1, 2, 3, 4]) AS sample
```

The query returns the following result.


| population | sample | 
| --- | --- | 
| `1.25` | `1.6666666666666667` | 

The following SQL query shows that the sample variance of a list with one element is `NULL`.

```sql
SELECT list_var_samp([5]) IS NULL AS one_element_is_null
```

The query returns the following result.


| one\_element\_is\_null | 
| --- | 
| `true` | 