VARIANCE

Description

Aggregate function.

The VAR(expr) function returns the population standard variance of expr.

Syntax

  1. > VAR(expr)

Arguments

ArgumentsDescription
exprAny numerical expressions

Examples

  1. > CREATE TABLE t1(PlayerName VARCHAR(100) NOT NULL,RunScored INT NOT NULL,WicketsTaken INT NOT NULL);
  2. > INSERT INTO t1 VALUES('KL Rahul', 52, 0 ),('Hardik Pandya', 30, 1 ),('Ravindra Jadeja', 18, 2 ),('Washington Sundar', 10, 1),('D Chahar', 11, 2 ), ('Mitchell Starc', 0, 3);
  3. > SELECT VAR(RunScored) as Pop_Standard_Variance FROM t1;
  4. > SELECT VAR(WicketsTaken) as Pop_Std_Var_Wickets FROM t1;
  5. > SELECT VAR(RunScored) as Pop_Standard_Deviation FROM t1;
  6. +------------------------+
  7. | Pop_Standard_Deviation |
  8. +------------------------+
  9. | 284.8056 |
  10. +------------------------+
  11. 1 row in set (0.04 sec)
  12. > SELECT VAR(WicketsTaken) as Pop_Std_Var_Wickets FROM t1;
  13. +---------------------+
  14. | Pop_Std_Var_Wickets |
  15. +---------------------+
  16. | 0.9167 |
  17. +---------------------+
  18. 1 row in set (0.04 sec)

Constraints

Currently, MatrixOne doesn’t support select function() without from tables.