INTERPOLATE PREVIOUS VALUE
I use INTERPOLATE PREVIOUS VALUE by time in query and I didn't understand the results,
CREATE TABLE data.timevalue ( unit_id int, field_id int, time_ timestamptz, value_ numeric(37,15), )
the data in the table are in different times for the different fields in the same unit.
I run 2 queries :
SELECT value_ ,time_ FROM data.timevalue WHERE time_ >='2019-09-21 07:43:00.000000' AND unit_id = 17 AND time_ <='2019-09-21 14:59:00.000000' AND field_id = 24;
SELECT time_ , field_Temp.value_ AS Temp FROM data.timevalue FULL OUTER JOIN ( SELECT value_ ,time_ FROM data.timevalue WHERE time_ >= '2019-09-21 07:43:00.000000' and unit_id = 17 AND time_ <='2019-09-21 14:59:00.000000' AND field_id = 24 )--Temp AS field_Temp ON time_ INTERPOLATE PREVIOUS VALUE field_Temp.time_ WHERE time_ >= '2019-09-21 07:43:00.000000' AND time_ <='2019-09-21 14:59:00.000000' AND unit_id = 17;
And now the questions:
1.In the png in the results, where did the data from the yellow part come from?
2.Is it correct to execute query # 2 when I have a lot of field_id like field =24 with different time, sometimes about the same time and sometimes a difference of a few single seconds and I need one report to all of them?
Thank you very much for your help!!