I have a table with value and timestamp columns. What I like to do (but am unable to find a solution) is to select the last(value) timestamp combination in every X minute interval where timestamp is between N and M. Is this possible with pgsql?
Look at:
generate_series(...)
date_part(...)
SELECT DISTINCT ON
You should consider providing a query with some test data.