Re: Consecutive row count query

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Leon Stringer <leon(dot)stringer(at)ntlworld(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Consecutive row count query
Date: 2005-03-17 21:32:31
Message-ID: c2d9e70e0503171332763fd02a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 17 Mar 2005 20:21:24 +0000, Leon Stringer
<leon(dot)stringer(at)ntlworld(dot)com> wrote:
> Hi,
>
> I wondered if anyone could answer the following question:
>
> If I have a table such as the one below:
>
> col1 col_order
> -----------
> Apple 1
> Apple 2
> Orange 3
> Banana 4
> Apple 5
>
> Is there a way I can get the following results:
>
> Apple 2
> Orange 1
> Banana 1
> Apple 1
>
A function?

regards,
Jaime Casanova

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2005-03-17 23:00:12 Re: Consecutive row count query
Previous Message Bruno Wolff III 2005-03-17 21:15:59 Re: Consecutive row count query