group number - Mailing list pgsql-sql

From Rene Romero Benavides
Subject group number
Date
Msg-id CANaGW0_KBbGbj1UbVnk6Ecu5AGHSqoxi==-Q6erDkdfaC=b_Nw@mail.gmail.com
Whole thread Raw
Responses Re: group number  (Pavel Stehule <pavel.stehule@gmail.com>)
List 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.

pgsql-sql by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: Re: Optimize query for listing un-read messages
Next
From: Pavel Stehule
Date:
Subject: Re: group number