Re: sequence number in a result - Mailing list pgsql-sql

From Relyea, Mike
Subject Re: sequence number in a result
Date
Msg-id 1806D1F73FCB7F439F2C842EE0627B1809BAD331@USA0300MS01.na.xerox.net
Whole thread Raw
In response to sequence number in a result  ("Campbell, Lance" <lance@illinois.edu>)
List 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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: trigger parameters, what am I doing wrong ??
Next
From: Steve Midgley
Date:
Subject: Re: many-to-many relationship