Thread: auto number

auto number

From
Marco Giardini
Date:
 how do i set a table with an autonumebr field? I mean a field that it's
automatically increased by one for each added record.
Thanks


.oesse.
--
------------------------------------------------------------------
+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
|m|a|r|c|o| |g|i|a|r|d|i|n|i|
+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
TecnoGi spa                                   Tel. +39 0321 885422
Strada per Gravellona                         Fax  +39 0321 885333
Borgolavezzaro (NO)                         http://www.tecnogi.com
Key fingerprint = B5 B4 AA 91 89 50 43 8F  B1 6B C6 8C 34 79 5A 7F

Re: [GENERAL] auto number

From
Peter Eisentraut
Date:
On Tue, 22 Feb 2000, Marco Giardini wrote:

>  how do i set a table with an autonumebr field? I mean a field that it's
> automatically increased by one for each added record.

Use a SERIAL column.

E.g.:

create table x (a text, b serial);
insert into x(a) values ('abc');

--
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden