Friday, February 25, 2011, 12:53:08 AM you wrote:
> select distinct on (a,b,c)
> a, b c, time_stamp,value
Without the comma, you declare 'b AS c'
> from data
> order by a, b, c, time_stamp desc;
> The output produced is the same as this query:
> select distinct on (a,b)
> a
P.S. I noticed inadvertently (by making a typo ;-) that not all of the
columns in the DISTINCT ON are required to be part of the output, in which
case it appears to reduce the DISTINCT ON to the columns that are
represented in my real world situation, "id_key" is actually composed
of 3 columns