Udostępnij za pośrednictwem


STDEV (Transact-SQL)

Returns the statistical standard deviation of all values in the specified expression. May be followed by the OVER clause.

Ikona łącza do tematu Transact-SQL Syntax Conventions

Składnia

STDEV ( [ ALL | DISTINCT ] expression ) 

Arguments

  • ALL
    Applies the function to all values. ALL is the default.

  • DISTINCT
    Specifies that each unique value is considered.

  • expression
    Is a numeric expression. Aggregate functions and subqueries are not permitted. expression is an expression of the exact numeric or approximate numeric data type category, except for the bit data type.

Return Types

float

Uwagi

If STDEV is used on all items in a SELECT statement, each value in the result set is included in the calculation. STDEV can be used with numeric columns only. Null values are ignored.

Examples

The following example returns the standard deviation for all bonus values in the SalesPerson table.

USE AdventureWorks2012;
GO
SELECT STDEV(Bonus)
FROM Sales.SalesPerson;
GO

Zobacz także

Odwołanie

Aggregate Functions (Transact-SQL)

OVER Clause (Transact-SQL)