sequence number in a result - Mailing list pgsql-sql

From Campbell, Lance
Subject sequence number in a result
Date
Msg-id B10E6810AC2A2F4EA7550D072CDE876001D20985@SAB-FENWICK.sab.uiuc.edu
Whole thread
Responses Re: sequence number in a result
Re: sequence number in a result
List pgsql-sql

Say I have the following SQL statement:

 

SELECT a, b, c FROM t1 ORDER BY a;

 

Is there a function or special system label I can use that would generate a sequence number in the returning result set?

 

Example:

SELECT a, b, c, SOMELABEL as order FROM t1 ORDER BY a;

 

Result:

a    b     c   order

---------------------

Aa  bb  cc  1

A1  bb  cc  2

A2  bb  cc  3

 

Thanks,

 

Lance Campbell

Project Manager/Software Architect

Web Services at Public Affairs

University of Illinois

217.333.0382

http://webservices.uiuc.edu

 

pgsql-sql by date:

Previous
From: "Sabin Coanda"
Date:
Subject: Re: 100% CPU at concurent access
Next
From: "Oliveiros Cristina"
Date:
Subject: Re: sequence number in a result