Re: Select the max on a field

From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Select the max on a field
Date: 2002-09-12 13:15:57
Message-ID: alq427$2ta2$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


"Gaetano Mendola" <mendola(at)bigfoot(dot)com> wrote in message
news:alq3mr$2s7o$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
> Hi all,
>
> Suppose that I have a table like this:
>
>
> att_1 | att_2 | att_3 | att_4
> --------------------------------
> 1 | a | y | y1
> 2 | b | y | y2
> 3 | a | xx | y3
> 4 | c | zz | y4
> 5 | a | t | y5
> 6 | c | x | y6
>
>
>
> I want obtain all row that have for each att_2
> the max of att_1

I forgot to say: "with a single total query without sub select "

Ciao
Gaetano

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-09-12 13:54:29 Re: still sorting and casting problems
Previous Message Gaetano Mendola 2002-09-12 13:09:53 Select the max on a field