Returns the statistical standard deviation of all values in the specified expression.
Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.
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.
STDEV is a deterministic function when used without the OVER and ORDER BY clauses. It is nondeterministic when specified with the OVER and ORDER BY clauses. For more information, see Deterministic and Nondeterministic Functions.
The following example returns the standard deviation for all bonus values in the SalesPerson table in the AdventureWorks2012 database.
SELECT STDEV(Bonus) FROM Sales.SalesPerson; GO