Skip to main content
Skip to main content

CORR

CORR

Description

Syntax

double corr(x, y)

Calculate the Pearson correlation coefficient, which is returned as the covariance of x and y divided by the product of the standard deviations of x and y. If the standard deviation of x or y is 0, the result will be 0.

example

mysql> select corr(x,y) from baseall;
+---------------------+
| corr(x, y) |
+---------------------+
| 0.89442719099991586 |
+---------------------+
1 row in set (0.21 sec)

keywords

CORR