SingleStore DB

VARIANCE

Aggregate function. Calculates the population variance value from a set of numbers. VARIANCE has synonym VAR_POP which is equivalent. VARIANCE returns NULL if there are not matching rows.

Syntax
VARIANCE ( expression )
Arguments
  • expression: any expression. This may be a column name, the result of another function, or a math operation.

Return Type

A double.

Examples
SELECT VARIANCE(table_rows) FROM information_schema.tables;
+----------------------+
| VARIANCE(table_rows) |
+----------------------+
|         2.1500       |
+----------------------+
1 row in set (2.87 sec)