COVAR_POP
Examples
select
covar_pop(alength, aheight) AS c_covar_pop
from measure
COVAR_POP
Examplesselect
covar_pop(alength, aheight) AS c_covar_pop
from measure
COVAR_SAMP()
Sample covariance
DOUBLE PRECISION
COVAR_SAMP ( <expr1>, <expr2> )
Parameter | Description |
---|---|
exprN |
Numeric expression.It may contain a table column, a constant, a variable, an expression, a non-aggregate function or a UDF.Aggregate functions are not allowed as expressions. |
The function COVAR_SAMP
returns the sample covariance for a pair of numerical expressions.
The function COVAR_SAMP(<expr1>, <expr2>)
is equivalent to
(SUM(<expr1> * <expr2>) - SUM(<expr1>) * SUM(<expr2>) / COUNT(*)) / (COUNT(*) - 1)
If the group or window is empty, contains only 1 row, or contains only NULL
values, the result will be NULL
.
COVAR_SAMP
Examplesselect
covar_samp(alength, aheight) AS c_covar_samp
from measure
STDDEV_POP()
Population standard deviation
DOUBLE PRECISION
or NUMERIC
depending on the type of expr
STDDEV_POP ( <expr> )
Parameter | Description |
---|---|
expr |
Numeric expression.It may contain a table column, a constant, a variable, an expression, a non-aggregate function or a UDF.Aggregate functions are not allowed as expressions. |
The function STDDEV_POP
returns the population standard deviation for a group or window.NULL
values are skipped.
The function STDDEV_POP(<expr>)
is equivalent to
SQRT(VAR_POP(<expr>))
If the group or window is empty, or contains only NULL
values, the result will be NULL
.