STDDEV_SAMP [aggregate]
Evaluates the statistical sample standard deviation for each member of the group.
Evaluates the statistical sample standard deviation for each member of the group. The return value is the same as the square root of
VAR_SAMP:
STDDEV_SAMP(expression) = SQRT(VAR_SAMP(expression))
Behavior type
ImmutableSyntax
STDDEV_SAMP ( expression )
Parameters
expression- Any
NUMERICdata type or any non-numeric data type that can be implicitly converted to a numeric data type.STDDEV_SAMPreturns the same data type asexpression.
Related functions
-
STDDEV_SAMPis semantically identical to nonstandard functionSTDDEV, which is provided for compatibility with other databases. -
This aggregate function differs from analytic function
STDDEV_SAMP, which computes the statistical sample standard deviation of the current row with respect to the group of rows within a window. -
When
VAR_SAMPreturnsNULL,STDDEV_SAMPreturnsNULL.
Examples
The following example returns the statistical sample standard deviation for each household ID from the customer dimension table.
=> SELECT STDDEV_SAMP(household_id) FROM customer_dimension;
stddev_samp
------------------
8651.50842400771
(1 row)