Robert Creager <Robert_Creager(at)LogicalChaos(dot)org> writes:
> ... one piece of data I need is the last value for each GROUP BY
> period. Alas, I cannot figure out how to do this.
SELECT DISTINCT ON (rather than GROUP BY) could get this done for you.
regards, tom lane