Re: Automatic row numbering / sequence in view ?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Automatic row numbering / sequence in view ?
Date: 2006-10-12 05:05:19
Message-ID: 20061012050519.GB32214@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message alexei.vladishev 2006-10-12 05:06:03 Re: more anti-postgresql FUD
Previous Message alexei.vladishev 2006-10-12 04:39:45 Re: more anti-postgresql FUD