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

# var_samp,variance_samp

> Returns the sample variance of an expression.

Returns the sample variance of an expression. Since v2.5.10, this function can also be used as a window function.

## Syntax

```Haskell theme={null}
VAR_SAMP(expr)
```

## Parameters

`expr`: the expression. If it is a table column, it must evaluate to TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, or DECIMAL.

## Return value

Returns a DOUBLE value.

## Examples

```plaintext theme={null}
MySQL > select var_samp(scan_rows)
from log_statis
group by datetime;
+-----------------------+
| var_samp(`scan_rows`) |
+-----------------------+
|    5.6227132145741789 |
+-----------------------+
```

## keyword

VAR\_SAMP,VARIANCE\_SAMP,VAR,SAMP,VARIANCE


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