Re: ids from grouped rows - Mailing list pgsql-sql

From Ragnar Hafstað
Subject Re: ids from grouped rows
Date
Msg-id 1121871013.17734.9.camel@localhost.localdomain
Whole thread Raw
In response to ids from grouped rows  (Lindsay <hellolindsay@gmail.com>)
List pgsql-sql
On Wed, 2005-07-20 at 08:46 -0400, Lindsay wrote:

> SELECT name, MAX(age), id_for_row_with_max_age
> FROM Person
> GROUP BY name

how about: select distinct on (name) name, age, id         from person        order by name, age desc;



gnari





pgsql-sql by date:

Previous
From: Lindsay
Date:
Subject: ids from grouped rows
Next
From: Erik Wasser
Date:
Subject: Re: [despammed] Re: 'show full processlist' in postgres?