stddev_samp()

Aggregate. Computes the standard deviation of a sample consisting of a numeric-expression, as a float.

Syntax

stddev_samp ( numeric-expression )

Parameters

numeric-expression

The expression, usually a column name, for which the sample-based standard deviation is calculated over a set of rows.

Usage

This function converts its argument to float, performs the computation in double-precision floating point, and returns a float. The standard deviation is used to find the amount of variation between data points and the groups average. The standard deviation is computed according to the following formula, which assumes a normal distribution:



This standard deviation does not include rows where numeric-expression is NULL. The function returns NULL for a group containing either 0 or 1 rows.

The standard deviation of a sample could be used to asses the rate of return of an investment of a determined period of time.