Computes the statistical variance of a population consisting of a numeric expression, as a double. varp is an alias for var_pop, and uses the same syntax.
var_pop ( [all | distinct] expression )
applies var_pop to all values. all is the default.
eliminates duplicate values before var_pop is applied.
is an expression—commonly a column name—in which its population-based variance is calculated over a set of rows.
Lists the average and variance of the advances for each type of book in the pubs2 database:
select type, avg(advance) as "avg", var_pop(advance) as "variance" from titles group by type order by type
Computes the population variance of the provided value expression evaluated for each row of the group (if distinct was specified, then each row that remains after duplicates have been eliminated), defined as the sum of squares of the difference of value expression, from the mean of value expression, divided by the number of rows in the group or partition.
Figure 2-3: The formula for population-related statistical aggregate functions
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute var_pop.
For general information about aggregate functions, see “Aggregate functions” in Adaptive Server Enterprise Reference Manual: Building Blocks.
Functions stddev_pop, stddev_samp, var_samp