row numbering

From: josue <josue(at)lamundial(dot)hn>
To: pgsql-general(at)postgresql(dot)org
Subject: row numbering
Date: 2005-02-25 22:44:58
Message-ID: 421FAA6A.1090606@lamundial.hn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello list,

is there a way return a column with the row number automatically
generated according the way the rows were processed by the query.

For instance:
select a,b from foo;
a b
20 yes
40 no
15 yes

to something like:

select counter(),a,b from foo;
counter a b
1 20 yes
2 40 no
3 15 yes

Thanks in advance,

--
Sinceramente,
Josué Maldonado.

... "El bien supone la luz, el mal tinieblas. Cada vez hay menos
iluminación."

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rick Schumeyer 2005-02-25 23:09:17 Is this correct behavior for ON DELETE rule?
Previous Message Tom Lane 2005-02-25 22:19:34 Re: Questions regarding notify processing.