> > and indeed that is the exact bug I found in Netezza! "first_value" > works great, "last_value" has window size 1 unless you also say "rows > between unbounded preceding and unbounded following". > What Tom said but: "...has window size 1" is not correct. The window size is larger but the returned value is always just going to be the current (last) row so it only appears to be "size 1" superficially. The query's frame/range/window specification is independent of the functions that use the window. If you are confused as to what is currently in the frame specification you should use something like ARRAY_AGG(...) OVER (...) To capture the relevant frame data into a single value. David J. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general