In Oracle/PLSQL, the covar_samp function returns the sample covariance of a set of number pairs.
Syntax
The syntax for the covar_samp function is:
covar_samp( expression1, expression2 )
expression1 is a numeric expression.
expression2 is a numeric expression.
Note
The covar_samp function eliminates all pairs where expression1 or expression2 has a null value.
Applies To
- Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
For Example
select owner, covar_samp(avg_row_len, avg_space)
from all_tables
group by owner;