COVAR_SAMP Function | Teradata Vantage - 17.10 - COVAR_SAMP - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

Returns the sample covariance of its arguments for all non-null data point pairs.

For the COVAR_SAMP window function that performs a group, cumulative, or moving computation, see Window Aggregate Functions.


Covariance measures whether or not two random variables vary in the same way. It is the sum of the products of deviations for each non-null data point pair.

Note that high covariance does not imply a causal relationship between the variables.


When there are no non-null data point pairs in the data used for the computation, then COVAR_SAMP returns NULL.

Division by zero results in NULL rather than an error.