Returns the statistical variance for the population for all values in the specified expression.
Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.
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.
VARP 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 variance for the population for all bonus values in the SalesPerson table in the AdventureWorks2012 database.
SELECT VARP(Bonus) FROM Sales.SalesPerson; GO