var_pop
Computes the population variance over each aggregate.
Syntax
var_pop([DISTINCT] arith_expr)
Arguments
| arith_expr | The arithmetic expression on which the population variance is to be computed. |
Description
This function computes the population variance for each aggregate from the value of arith_expr for each row in the aggregate. The denominator used in the population variance calculation is the number of rows contained in each aggregate.
If distinct is specified, duplicate values are not included in the computation.
Example
open nsfawards;
select orgid, count(*), var_pop(amount) from nsforg natural join award
group by 1 having count(*) >= 5000;
orgid count(*) var_pop(amount)
CHE 5702 332825267367.36
DMI 6526 68722383064.2109
DMR 5381 5871434338457.79
DMS 9910 252900623559.659
DUE 8810 168024018384.17
EAR 7256 2633250591881.39
IBN 5438 66033532735.8391
INT 5954 361800626996.108
OCE 5998 15837707685054.4
SES 5944 130133272964.206