I am storing sparse data in a number of fields where some fields may have a new value every second and others maybe every 10 seconds or 1 minute or even longer.
When querying, I would like to get the latest value for each field including the timestamp.
time field1 field2 2020-03-17T09:00:00Z null 1.0 2020-03-18T10:00:00Z 2.5 null
I have tried these queries:
Does not return the latest value for each field:
SELECT * FROM "db"."ret"."meas" ORDER BY "time" DESC LIMIT 1
Does not return the date but instead just shows the first possible date (1970):
SELECT LAST(*) FROM "db"."ret"."meas" ORDER BY "time" DESC
Is that possible at all in a single query?