Automatic row numbering / sequence in view ?

Started by Arnaud Lesauvageover 19 years ago2 messagesgeneral
Jump to latest
#1Arnaud Lesauvage
thewild@free.fr

Hi List !

I need to add a column to a view, which would contain an automatically
generated sequence.
An automatic row numbering would do the trick (I only need unique
numbers, that's all), but I don't even know how to achieve this.
Does anybody have a solution for this problem ?

Thanks a lot !
--
Arnaud

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: Arnaud Lesauvage (#1)
Re: Automatic row numbering / sequence in view ?

am Tue, dem 10.10.2006, um 16:33:03 +0200 mailte Arnaud Lesauvage folgendes:

Hi List !

I need to add a column to a view, which would contain an automatically
generated sequence.
An automatic row numbering would do the trick (I only need unique
numbers, that's all), but I don't even know how to achieve this.
Does anybody have a solution for this problem ?

create sequence foo;
select nextval('foo'), * from <yourtable>;

HTH, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net