- Categories:
Aggregate functions (General) , Window functions (General)
COVAR_ POP¶
Returns the population covariance for non-null pairs in a group. It is computed for non-null pairs using the following formula:
(SUM(x*y) - SUM(x) * SUM(y) / COUNT(*)) / COUNT(*)
Where x is the independent variable and y is the dependent variable.
- See also:
COVAR_SAMP , COUNT , SUM
Syntax¶
Aggregate function
Window function
Usage notes¶
- DISTINCT is not supported for this function.
- When this function is called as a window function, it does not support:
- An ORDER BY clause within the OVER clause.
- Explicit window frames.