Re: Top N within groups? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Top N within groups?
Date
Msg-id 20080712150722.GA3535@depesz.com
Whole thread Raw
In response to Top N within groups?  (Klint Gore <kgore4@une.edu.au>)
List pgsql-general
On Fri, Jul 11, 2008 at 01:24:28PM +1000, Klint Gore wrote:
> Can someone familiar with the source for DISTINCT ON comment on how hard
> it would be to add another parameter to return more than one row?

you can make top-n per group quite easily using the technique described
here:
http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in-one-query/

best regards,

depesz


pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Default fill factor for tables?
Next
From: "Wm. Stewart"
Date:
Subject: Wiki: FreeOpenSourceSoftware.org