Re: A counter argument about DISTINCT and GROUP BY in PostgreSQL - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: A counter argument about DISTINCT and GROUP BY in PostgreSQL
Date
Msg-id 20080104165052.GC16708@alvh.no-ip.org
Whole thread Raw
In response to A counter argument about DISTINCT and GROUP BY in PostgreSQL  (dterrors@hotmail.com)
List pgsql-general
dterrors@hotmail.com wrote:
>
> I've just spent a few hours searching and reading about the postgres
> way of selecting distinct records.  I understand the points made about
> the ORDER BY limitation of DISTINCT ON, and the abiguity of GROUP BY,
> but I think there's a (simple, common) case that have been missed in
> the discussion. Here is my sitation:

Did you try putting the DISTINCT ON in a subselect, and the ORDER BY in
an outer select?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: A counter argument about DISTINCT and GROUP BY in PostgreSQL
Next
From: "beer@cmu.edu"
Date:
Subject: data volume resizing and large objects