New answers tagged

1

You can use conditional aggregation for this. In PostgreSQL you can use the FILTER clause. In other DBMSs you can use a condition inside the aggregation avg(case when ... then value end) SELECT time_bucket_gapfill('30s', time, start => '2021-07-19T09:06:26.605Z', finish => '2021-07-19T20:11:12.340Z') AS "time", max(value) FILTER (...


Top 50 recent answers are included