How can I make SELECT return tuple numbers?

From: Roy Souther <roy(at)SiliconTao(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: How can I make SELECT return tuple numbers?
Date: 2005-07-06 03:34:51
Message-ID: 1120620891.9954.10.camel@UtopiaPlanetia
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there any way to make a SELECT return an extra field that is a
sequential number for the tuples that are returned?
I am trying to populate a table with an INSERT SELECT and would like to
make one of the fields a sequence starting with 1 for the first tuple
and incromenting. I don't want the field to be a unique index. As the
query is run again and again I want more tuples appended to the table
and each time the counter should start at 1 and count up.

Roy Souther
www.SiliconTao.com
Let Open Source help your business move beyond.

For security this message is digitally authenticated by GnuPG.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-07-06 03:55:48 Re: How can I make SELECT return tuple numbers?
Previous Message David Gagnon 2005-07-05 23:48:05 Re: double entries into database when using IE