Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ClickHouse launches Claude-powered Agents and House Mates partner program at Open House 2026 Read more →
重み付き算術平均を計算します。
avgWeighted(x, weight)
x
(U)Int*
Float*
weight
NaN
Float64
SELECT avgWeighted(x, w) FROM VALUES('x Int8, w Int8', (4, 1), (1, 0), (10, 2))
┌─avgWeighted(x, w)─┐ │ 8 │ └───────────────────┘
SELECT avgWeighted(x, w) FROM VALUES('x Int8, w Float64', (4, 1), (1, 0), (10, 2))
SELECT avgWeighted(x, w) FROM VALUES('x Int8, w Int8', (0, 0), (1, 0), (10, 0))
┌─avgWeighted(x, w)─┐ │ nan │ └───────────────────┘
CREATE TABLE test (t UInt8) ENGINE = Memory; SELECT avgWeighted(t, t) FROM test
┌─avgWeighted(t, t)─┐ │ nan │ └───────────────────┘
このページは役に立ちましたか?