Re: writing a MIN(RECORD) aggregate - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: writing a MIN(RECORD) aggregate
Date
Msg-id 87fxuemy0x.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: writing a MIN(RECORD) aggregate  (Sam Mason <sam@samason.me.uk>)
Responses Re: writing a MIN(RECORD) aggregate
List pgsql-hackers
"Sam Mason" <sam@samason.me.uk> writes:

>   SELECT i, MIN(k) OVER (PARTITION BY j)
>   FROM tbl
>   GROUP BY i;
>
> This is obviously wrong, but I don't see how to get to where I need to
> be.

I'm not entirely sure myself. I think it might involve RANK OVER j though.

I suspect it will look more like the DISTINCT ON solution than the min(record)
solution.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Wiki patch queue
Next
From: Kurt Roeckx
Date:
Subject: Re: gcc 4.3 breaks ContribCheck in 8.2 and older.