How to get the position of each record in a SELECT statement

Поиск
Список
Период
Сортировка
От JORGE MALDONADO
Тема How to get the position of each record in a SELECT statement
Дата
Msg-id CAAY=A7_PdEeLWtQev0ZDnky9b4PzU1QHn0JYK4S5fS4qXG3kig@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to get the position of each record in a SELECT statement  (Stephen Tahmosh <stahmosh@shieldsrx.com>)
Re: How to get the position of each record in a SELECT statement  (Adelo Herrero Pérez <adelo.herrero@gmail.com>)
Список pgsql-sql
Let´s say that I have the following simple SELECT statement:

SELECT first, id FROM customers ORDER BY first

This would result in something like this:
Charles    C1001
John        A3021
Kevin      F2016
Paul        N4312
Steve      J0087

Is it possible to include a "field" in the SELECT such that it represents the position of each record?
For example, I need to get a result like this:

1    Charles    C1001
2    John        A3021
3    Kevin      F2016
4    Paul        N4312
5    Steve      J0087

Respectfully,
Jorge Maldonado

В списке pgsql-sql по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Large Objects
Следующее
От: Stephen Tahmosh
Дата:
Сообщение: Re: How to get the position of each record in a SELECT statement