From: kkeller@speakeasy.net
To: pgsql-sql@postgresql.org
Subject: obtaining row number of select
Date: Mon, 11 Feb 2002 18:23:43 -0800
Message-ID: <fbu94a.31f.ln@wombat.san-francisco.ca.us> (raw)
So I'm trying to generate a pseudo-serial number of a select
statement on the fly, and I want to do so within the select
statement. I could do this programmatically, but I wish to
use the select statement so that I can use it in creating a
view.
So, I would like to do something like so:
select serial(),* from mytable order by 1;
But of course that won't work. :) Is there any way to
autovivify a serial-like column for a select statement?
(I've scoured the docs, and still can't find an answer.)
--keith
--
kkeller@speakeasy.net
public key: http://wombat.san-francisco.ca.us/kkeller/public_key
alt.os.linux.slackware FAQ: http://wombat.san-francisco.ca.us/perl/fom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: kkeller@speakeasy.net
Subject: Re: obtaining row number of select
In-Reply-To: <fbu94a.31f.ln@wombat.san-francisco.ca.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox