Re: Autoincrement value in a SELECT statement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Autoincrement value in a SELECT statement
Дата
Msg-id 9677.1471738196@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Autoincrement value in a SELECT statement  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-sql
JORGE MALDONADO <jorgemal1960@gmail.com> writes:
> Is it possible to include a field in the SELECT statement which "kind of
> autoincrements" so I can get the position?

The row_number() window function should do that for you, or you might
want rank() depending on what you think should happen for ties.
        regards, tom lane



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

Предыдущее
От: JORGE MALDONADO
Дата:
Сообщение: Autoincrement value in a SELECT statement
Следующее
От: CN
Дата:
Сообщение: Display group title only at the first record within each group