Received: from jupiter.hub.org (jupiter.hub.org [64.49.215.5]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1C2rRE14365 for ; Mon, 11 Feb 2002 21:53:27 -0500 (EST) (envelope-from news@jupiter.hub.org) Received: (from news@localhost) by jupiter.hub.org (8.11.6/8.11.6) id g1C2PVh95661 for pgsql-sql@postgresql.org; Mon, 11 Feb 2002 20:25:31 -0600 (CST) (envelope-from news) From: kkeller@speakeasy.net (Keith Keller) X-Newsgroups: comp.databases.postgresql.sql Subject: obtaining row number of select Date: Mon, 11 Feb 2002 18:23:43 -0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 21 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@hub.org X-Newsreader: knews 1.0b.1 To: pgsql-sql@postgresql.org X-Archive-Number: 200202/221 X-Sequence-Number: 6645 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