COVAR,COVAR_POP
Descriptionβ
Calculate the covariance between two numeric variables.
Aliasβ
- COVAR_POP
Syntaxβ
COVAR(<expr1>, <expr2>)
Parametersβ
Parameter | Description |
---|---|
<expr1> | Numeric expression or column |
<expr2> | Numeric expression or column |
Return Valueβ
Returns the covariance value of expr1 and expr2, special case:
- If a column of expr1 or expr2 is NULL, the row data will not be counted in the final result.
Exampleβ
select covar(x,y) from baseall;
+---------------------+
| covar(x, y) |
+---------------------+
| 0.89442719099991586 |
+---------------------+