group number

From: Rene Romero Benavides <rene(dot)romero(dot)b(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: group number
Date: 2014-05-09 20:15:51
Message-ID: CANaGW0_KBbGbj1UbVnk6Ecu5AGHSqoxi==-Q6erDkdfaC=b_Nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thank you very much for your attention.

I'm facing a mental block to achieve this in a performant manner:

Input:
a
a
b
c
c
c
d

Desired output:

a 1
a 1
b 2
c 3
c 3
c 3
d 4

Any suggestions? Have a good day (night, afternoon or evening) and
greetings from México City.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2014-05-09 20:22:03 Re: group number
Previous Message Andreas Joseph Krogh 2014-05-04 18:03:23 Re: Optimize query for listing un-read messages