Re: [SQL] Aggregates (last/first) not behaving

2010-07-22 Thread Wes Devauld
I believe I lost the flavour of what I'm doing when I constructed this example. I'm not interested in the timepoint as much as the value that is attached to it. I need to be able to find the last chronological record for a given day. I can get the value for which I am looking in two steps: sele

[SQL] Aggregates (last/first) not behaving

2010-07-21 Thread Wes Devauld
I have PostgreSQL 8.3.9 [PostgreSQL 8.3.9 on i386-apple-darwin10.3.0, compiled by GCC i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1)] and the custom first and last aggregates from: http://wiki.postgresql.org/wiki/First_(aggregate) http://wiki.postgresql.org/wiki/Last_(a