SQL/MX 3.1 Reference Manual (H06.23+, J06.12+)
SQL/MX Functions and Expressions
HP NonStop SQL/MX Release 3.1 Reference Manual—663850-001
9-206
Examples of VARIANCE
°
Find the variance of the TEMPERATURE column:
SELECT VARIANCE(temperature) FROM weather;
(EXPR)
-------------------------
1.64500000000000024E+002
--- 1 row(s) selected.
°
Find the variance of the TEMPERATURE column by CITY:
SELECT city, VARIANCE (temperature)
FROM weather GROUP BY city;
CITY (EXPR)
---------- -------------------------
Austin 3.55666666666666720E+002
Cupertino 0.00000000000000000E+000
--- 2 row(s) selected.
°
Find the weighted variance of the TEMPERATURE column:
SELECT VARIANCE (temperature, weight) FROM weather;
(EXPR)
-------------------------
1.46363636363636384E+002
--- 1 row(s) selected.










