Aggregates
Aggregate
corr()
Returns the correlation coefficient for non-null pairs in a group.
Arguments & returns
corr(y, x)
Aggregate
| Overload link | y | x |
Returns |
|---|---|---|---|
| #01 | DOUBLE | DOUBLE |
DOUBLE |
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example with sample data · Run to view results.
In other engines
Used in larger rewrites 1
These examples use corr as one part of a larger SQL translation.
Snowflakecorr()
SELECT CORR(a, b)
SELECT CASE WHEN ISNAN(CORR(a, b)) THEN NULL ELSE CORR(a, b) END