Re: DISTINCT ON without ORDER BY - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: DISTINCT ON without ORDER BY
Date
Msg-id 20090422062724.GA21883@svana.org
Whole thread Raw
In response to Re: DISTINCT ON without ORDER BY  (Jasen Betts <jasen@xnet.co.nz>)
List pgsql-general
On Tue, Apr 21, 2009 at 12:11:26PM +0000, Jasen Betts wrote:
> > Is there a way to acheive the above result without a sort and without a
> > self-join?
>
> anyway you could possibly write an agregate function that returns a
> copy of the row with the highest id?

Put that way it sounds like something for a window function. Not sure
if they can use a HashAggrgate though.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: No connection could be made because the target machine actively refused it
Next
From: Emi Lu
Date:
Subject: What may cause - Connection rejected: FATAL: Ident authentication failed for user?