average()
average(
tws TimeWeightSummary
) RETURNS DOUBLE PRECISION
A function to compute a time weighted average from a TimeWeightSummary
.
Required arguments
Name | Type | Description |
---|---|---|
tws | TimeWeightSummary | The input TimeWeightSummary from a time_weight call |
Returns
Column | Type | Description |
---|---|---|
average | DOUBLE PRECISION | The time weighted average computed from the TimeWeightSummary |
Sample usage
SELECT
id,
average(tws)
FROM (
SELECT
id,
time_weight('LOCF', ts, val) AS tws
FROM foo
GROUP BY id
) t
当前内容版权归 TimescaleDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 TimescaleDB .