create table mytable (
myfield serial primary key,
myotherfield integer);

Using the SERIAL data type automatically creates the sequence and default
statements for you.

-----Original Message-----
From: Mayuresh Kadu [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 2:36 AM
To: [EMAIL PROTECTED]
Subject: [SQL] Auto Increment

hi all,

could anyone tell me how to make a primary key to AUTO INCREMENT. The
document is not exactly very explainatory about it :)

Thankx in advance ...



Mayuresh



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to