Export (0) Print
Expand All

VARP (Transact-SQL)

Returns the statistical variance for the population for all values in the specified expression. May be followed by the OVER clause.

Topic link icon Transact-SQL Syntax Conventions

VARP ( [ ALL | DISTINCT ] expression )

ALL

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

DISTINCT

Specifies that each unique value is considered.

expression

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

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

The following example returns the variance for the population for all bonus values in the SalesPerson table.

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

Community Additions

ADD
Show:
© 2014 Microsoft