Re: enumerating rows - Mailing list pgsql-sql

From Kovacs Zoltan
Subject Re: enumerating rows
Date
Msg-id Pine.LNX.4.21.0104111630350.3812-100000@pc10.radnoti-szeged.sulinet.hu
Whole thread Raw
In response to Re: enumerating rows  ("Poul L. Christiansen" <poulc@cs.auc.dk>)
Responses Re: enumerating rows
List pgsql-sql
> Use the "serial" column type.
Unfortunately it's not what I expect. Assume that I have an arbitrary 
"SELECT expr1 as column1, expr2 as column2, ..." which gives

column1 | column2 |  ...
--------+---------+- ...
......data..............
........................

I would like to get the same result with the only plus column row_no:

row_no | column1 | column2 |  ...
-------+---------+---------+- ...    1 | ......data..............    2 | ........................
.................................

with a new SELECT statement: "SELECT ?????, expr1 as column1, expr2 as
column2, ...". What to write instead of ??????

TIA, Zoltan



pgsql-sql by date:

Previous
From: cbell
Date:
Subject: Re: Re: \i command
Next
From: "Koen Antonissen"
Date:
Subject: RE: enumerating rows