コンテンツにスキップ

集計関数です。

SKEWNESS() 関数は、すべての入力値の歪度を返します。

func.skewness(<expr>)
func.skewness(table.temperature).alias('temperature_skewness')
| temperature_skewness |
|----------------------|
| 0.68 |
SKEWNESS(<expr>)
引数 説明
<expr> 任意の数値式

Nullable Float64。

テーブルの作成とサンプルデータの挿入

CREATE TABLE temperature_data (
id INT,
city_id INT,
temperature FLOAT
);
INSERT INTO temperature_data (id, city_id, temperature)
VALUES (1, 1, 60),
(2, 1, 65),
(3, 1, 62),
(4, 2, 70),
(5, 2, 75);

クエリのデモ: 気温データの歪度を計算する

SELECT SKEWNESS(temperature) AS temperature_skewness
FROM temperature_data;

結果

| temperature_skewness |
|----------------------|
| 0.68 |