Re: fetch first rows of grouped data - Mailing list pgsql-sql

From Michael Glaesemann
Subject Re: fetch first rows of grouped data
Date
Msg-id 2A02E93C-62E7-4D94-8559-B0999835698F@seespotcode.net
Whole thread Raw
In response to Re: fetch first rows of grouped data  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: fetch first rows of grouped data  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-sql
On Aug 28, 2007, at 4:14 , hubert depesz lubaczewski wrote:

> On Mon, Aug 27, 2007 at 06:36:47PM +0200, Claudia Kosny wrote:
>> Is there a way to do this with one query?
>> I am using PostgreSQL 7.4.
>
> you can try to use "distinct on".

I considered that as well, but couldn't think of a way to return more  
than one row per "distinct on condition". I'd be interested to hear  
if you've thought of a way to use DISTINCT ON in this situation.


Michael Glaesemann
grzm seespotcode net




pgsql-sql by date:

Previous
From: "Sebastian Ritter"
Date:
Subject: Re: Database normalization
Next
From: "Asko Oja"
Date:
Subject: Re: Database normalization