---
title: skewness aggregate function
description: Learn the syntax of the skewness function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/skewness
---

# `skewness` aggregate function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns the skewness value calculated from values of a group.

## Syntax

```
skewness ( [ALL | DISTINCT ] expr ) [FILTER ( WHERE cond ) ]
```

This function can also be invoked as a [window function](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-window-functions.md) using the `OVER` clause.

## Arguments

* `expr`: An expression that evaluates to a numeric.
* `cond`: An optional `BOOLEAN` expression filtering the rows used for aggregation.

## Returns

A `DOUBLE`.

If `DISTINCT` is specified the function operates only on a unique set of `expr` values.

## Examples

```sql
> SELECT skewness(col) FROM VALUES (-10), (-20), (100), (1000), (1000) AS tab(col);
 0.3853941073355022

> SELECT skewness(DISTINCT col) FROM VALUES (-10), (-20), (100), (1000), (1000) AS tab(col);
 1.1135657469022011

> SELECT skewness(col) FROM VALUES (-1000), (-100), (10), (20) AS tab(col);
 -1.1135657469022011
```

## Related

* [`kurtosis` aggregate function](https://docs.databricks.com/aws/en/sql/language-manual/functions/kurtosis.md)
* [Window functions](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-window-functions.md)
