Re: Distinct on a non-sort column - Mailing list pgsql-general

From John R Pierce
Subject Re: Distinct on a non-sort column
Date
Msg-id 4EB5955E.4000908@hogranch.com
Whole thread Raw
In response to Distinct on a non-sort column  (Cstdenis <lists@on-track.ca>)
List pgsql-general
On 11/05/11 11:39 AM, Cstdenis wrote:
> example query: /select distinct on (user_id) * from stories order by
> date_submitted desc limit 10;/


select user_id,max(date_submitted) from stories group by date_submitted;

?

--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


pgsql-general by date:

Previous
From: Oliver Kohll - Mailing Lists
Date:
Subject: Fwd: explain analyse and nested loop joins
Next
From: Antonio Goméz Soto
Date:
Subject: Re: What is *wrong* with this query???