メインコンテンツまでスキップ
バージョン: 4.x

COVAR_SAMP

説明

2つの数値変数間の標本共分散を計算します。

構文

COVAR_SAMP(<expr1>, <expr2>)

パラメータ

Parameterデスクリプション
<expr1>数値式または列
<expr2>数値式または列

Return Value

expr1とexpr2のサンプル共分散を返します。特別なケース:

  • expr1またはexpr2の列がNULLの場合、その行のデータは最終結果にカウントされません。

Example

select covar_samp(x,y) from baseall;
+---------------------+
| covar_samp(x, y) |
+---------------------+
| 0.89442719099991586 |
+---------------------+