Michael Glaesemann <grzm@xxxxxxxxxxxxxxx> wrote: > SELECT DISTINCT ON (data.id_key) > data.id_key, data.time_stamp, data.value > FROM data > ORDER BY data.id_key, data.time_stamp DESC; Dang! I forgot the DESC in my post! Thanks for showing the *correct* version. -Kevin -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance