Re: How can I get the last element out of GROUP BY sets? - Mailing list pgsql-sql

From Tom Lane
Subject Re: How can I get the last element out of GROUP BY sets?
Date
Msg-id 20989.1074491070@sss.pgh.pa.us
Whole thread Raw
In response to How can I get the last element out of GROUP BY sets?  (Robert Creager <Robert_Creager@LogicalChaos.org>)
Responses Re: How can I get the last element out of GROUP BY sets?
Re: How can I get the last element out of GROUP BY sets?
List pgsql-sql
Robert Creager <Robert_Creager@LogicalChaos.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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Execute permissions for stored functions
Next
From: Tom Lane
Date:
Subject: Re: DROP TRIGGER