Reputation: 1
I have a SQL statement that counts every second of status in TDengine.
SELECT
first(ts),
voltage
FROM
d1
where
ts >= '2017-07-14 10:40:00.000'
AND ts <= '2017-07-14 10:41:00.066' INTERVAL(1s)
There are 3 seconds of data that are missing, as shown in the figure.
If there is no value, I would like to use a previous non-null value in the query instead. So I tried to add a FILL(PREV);
. However, the result doesn't look right.
How do I modify this statement?
Upvotes: 0
Views: 57
Reputation: 41
Maybe you can try this:
SELECT
_wstart,
first(voltage)
FROM
d1
where
ts >= '2017-07-14 10:40:00.000'
AND ts <= '2017-07-14 10:41:00.066'
INTERVAL(1s) FILL(PREV)
Upvotes: 0