Re: Autoincrement value in a SELECT statement - Mailing list pgsql-sql

From Tom Lane
Subject Re: Autoincrement value in a SELECT statement
Date
Msg-id 9677.1471738196@sss.pgh.pa.us
Whole thread Raw
In response to Autoincrement value in a SELECT statement  (JORGE MALDONADO <jorgemal1960@gmail.com>)
List 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 by date:

Previous
From: JORGE MALDONADO
Date:
Subject: Autoincrement value in a SELECT statement
Next
From: CN
Date:
Subject: Display group title only at the first record within each group