std aggregate function

Returns the sample standard deviation calculated from the values within the group.

Syntax

std ( [ALL | DISTINCT] expr ) [FILTER ( WHERE cond ) ]

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.

This function is a synonym for stddev aggregate function.

Examples

> SELECT std(col) FROM VALUES (1), (2), (3), (3) AS tab(col);
 0.9574271077563381
> SELECT std(DISTINCT col) FROM VALUES (1), (2), (3), (3) AS tab(col);
 1.0