I have a time-series table which looks like the following:
time | a | b | c | d
--------------------+---------+----------+---------+---------
2016-05-15 00:08:22 | | | |
2016-05-15 01:50:56 | | | 26.8301 |
2016-05-15 02:41:58 | | | |
2016-05-15 03:01:37 | | | |
2016-05-15 04:45:18 | | | |
2016-05-15 05:45:32 | | | 26.9688 |
2016-05-15 06:01:48 | | | |
2016-05-15 07:47:56 | | | | 27.1269
2016-05-15 08:01:22 | | | |
2016-05-15 09:35:36 | 26.7441 | 29.8398 | | 26.9981
2016-05-15 10:08:53 | | | |
2016-05-15 11:08:30 | | | |
2016-05-15 12:14:59 | | | |
2016-05-15 13:33:36 | 27.4277 | 29.7695 | |
2016-05-15 14:36:36 | 27.4688 | 29.6836 | |
2016-05-15 15:37:36 | 27.1016 | | |
I want to return last non-null values of every column:
like this (best option):
time | column | value
--------------------+--------- +-------
2016-05-15 15:37:36 | a | 27.1016
2016-05-15 14:36:36 | b | 29.6836
2016-05-15 05:45:32 | c | 26.9688
2016-05-15 09:35:36 | d | 26.9981
like this:
column | value
-------- +-------
a | 27.1016
b | 29.6836
c | 26.9688
d | 26.9981
or at least like this:
a | b | c | d
--------+----------+---------+---------
27.1016 | 29.6836 | 26.9688 | 26.9981
Thanks!