Re: sequence number in a result

From: "Relyea, Mike" <Mike(dot)Relyea(at)xerox(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Cc: "Campbell, Lance" <lance(at)illinois(dot)edu>
Subject: Re: sequence number in a result
Date: 2008-10-09 17:05:47
Message-ID: 1806D1F73FCB7F439F2C842EE0627B1809BAD331@USA0300MS01.na.xerox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Would something like this work for you?

CREATE TEMP SEQUENCE foo;
SELECT a, b, c, nextval('foo') AS order FROM t1 ORDER BY a;

Mike Relyea
Product Development Engineer
Xerox Corporation
Building 218 Room 107
800 Phillips Rd
Webster, NY 14580

p 585.265.7321

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2008-10-09 17:14:24 Re: sequence number in a result
Previous Message Oliveiros Cristina 2008-10-09 16:49:56 Re: sequence number in a result