Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 STDEV (Transact-SQL)
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
Other versions are also available for the following:
SQL Server 2008 Books Online (October 2009)
STDEV (Transact-SQL)

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

Topic link icon Transact-SQL Syntax Conventions

STDEV ( [ ALL | DISTINCT ] expression ) 
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.

float

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.

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

USE AdventureWorks;
GO
SELECT STDEV(Bonus)
FROM Sales.SalesPerson;
GO
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker