Fill gaps in data |
Fill gaps in data with SQL |
Use [`date_bin_gapfill`](/influxdb3/core/reference/sql/functions/time-and-date/#date_bin_gapfill) with [`interpolate`](/influxdb3/core/reference/sql/functions/misc/#interpolate) or [`locf`](/influxdb3/core/reference/sql/functions/misc/#locf) to fill gaps of time where no data is returned.
|
|
206 |
```sql
SELECT
date_bin_gapfill(INTERVAL '30 minutes', time) as time,
room,
interpolate(avg(temp))
FROM home
WHERE
time >= '2022-01-01T08:00:00Z'
AND time <= '2022-01-01T10:00:00Z'
GROUP BY 1, room
```
|
/shared/influxdb3-query-guides/sql/fill-gaps.md |