Re: find the greatest, pick it up and group by - Mailing list pgsql-general

From David Johnston
Subject Re: find the greatest, pick it up and group by
Date
Msg-id 001b01cc1426$2bae2e90$830a8bb0$@yahoo.com
Whole thread Raw
In response to find the greatest, pick it up and group by  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: find the greatest, pick it up and group by  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-general
When asking for help on non-trivial SELECT queries it really helps to tell
us the version of PG you are using so that responders know what
functionality you can and cannot use.  In this case specifically, whether
WINDOW (and maybe WITH) clauses available?

David J.

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Ivan Sergio Borgonovo
> Sent: Monday, May 16, 2011 7:39 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] find the greatest, pick it up and group by
>
>
> I'd like to group by idordine, grupposped, idart.
> For every row grouped that way, I'd like to pick the greatest of the
> q* columns and insert:
> idordine, grupposped, idart, name of the greatest(q*) in a new table.
> I don't mind if more than one q* column is equal to greatest(q*). It
should
> pick up one, just one no matter which among the one equal to greatest(q*).
>
> I think this way works but it hurts my eyes. Any alternative approach?
>



pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: COPY complaining about unquoted carriage return found in data... in a quoted field
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: find the greatest, pick it up and group by