Oracle/PLSQL: Corr Function
In Oracle/PLSQL, the corr function returns the coefficient of correlation of a set of number pairs.
The syntax for the corr function is:
corr( n ,m ) [ over (analytic_clause) ]
n and m are the numbers to use to calculate the cofficient of correlation.
The corr function requires at least two rows.
Applies To:
- Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
For example:
select corr(quantity, commission)
from sales;
select max_entents, corr(max_trans, initial_extent)
from data
group by max_extents;
