Sample Header Ad - 728x90

Resample time series in SQLite

1 vote
0 answers
447 views
I have following table:
CREATE TABLE entries (
  utc TEXT,
  entry INTEGER
);
with following data:
INSERT INTO entries
  (utc, entry)
VALUES
  ('2022-10-01 01:54', 23),
  ('2022-10-04 02:40', 46),
  ('2022-10-09 16:20', 51),
  ('2022-10-10 04:05', 81),
  ('2022-10-16 12:26', 78);
How can I write a query to get the daily value (linear interpolated) like this:
utc              | entry
-----------------|------
2022-10-01 00:00 | …
2022-10-02 00:00 | …
2022-10-03 00:00 | …
…                | …
Here is a pre-filled dbfiddle for playing around: https://dbfiddle.uk/TCX9Rd5t
Asked by adius (113 rep)
Oct 26, 2022, 11:19 AM