Received: from deborah.paradise.net.nz (deborah.paradise.net.nz [203.96.152.32]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8IMsvd77811 for ; Tue, 18 Sep 2001 18:54:58 -0400 (EDT) (envelope-from csawtell@paradise.net.nz) Received: from berty.localnet (202-0-37-152.cable.paradise.net.nz [202.0.37.152]) by deborah.paradise.net.nz (Postfix) with ESMTP id C87FF1F9EEB; Wed, 19 Sep 2001 10:54:49 +1200 (NZST) Subject: Re: Number the lines From: Christopher Sawtell To: Kovacs Baldvin Cc: pgsql-sql@postgresql.org In-Reply-To: Content-Type: text/plain X-Mailer: Evolution (0.9 - Preview Release) Date: 19 Sep 2001 10:54:26 +1200 Mime-Version: 1.0 Message-Id: <20010918225449.C87FF1F9EEB@deborah.paradise.net.nz> X-Archive-Number: 200109/131 X-Sequence-Number: 4809 On 17 Sep 2001 14:54:51 +0200, Kovacs Baldvin wrote: > Hi! > > I am in the university now, not be able to test what I > say, so please forgive me if it is buggy or wrong. > > So does it helps you?: That works correctly. Thanks very much for the tip . Do not forget to DROP the sequence afterwards, otherwise you will find the line numbers continuing the sequence in the next SELECT statement. > CREATE SEQUENCE ordering; > SELECT NEXTVAL('ordering') as rownumber, * > INTO TABLE anewname FROM whatyouwant; > > Probably CREATE SEQUENCE 'ordering';, do try it... No, you do not need the quote characters. Sincerely etc.. C.