stddev_samp

Computes the standard deviation of a sample consisting of a numeric expression as a double. stdev and stddev are aliases for stddev_samp, and use the same syntax.

Syntax

stddev_samp ( [ all | distinct ] expression )

Parameters

Examples

Usage

Computes the sample standard deviation of the provided value expression evaluated for each row of the group (if distinct was specified, then each row that remains after duplicates have been eliminated), defined as the square root of the sample variance.

Formula for Sample-Related Statistical Aggregate Functions
The formula for sample-related statistical aggregate functions.

See also Transact-SQL Users Guide.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute stddev_samp.

Related reference
stddev_pop
var_pop
var_samp