make a filled column auto_increment
| From: | Bas Jobsen | Date: | Sat, 06 Oct 2001 10:36:56 +0000 |
| Subject: | make a filled column auto_increment | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13063@lists.php.net to get a copy of this message | ||
Hello,
How can i make a column auto_increment?
my table (table1):
id|others
0|x
1|x
2|x
etc
ALTER TABLE table1 ADD PRIMARY KEY (id); #oke
ALTER TABLE table1 ADD UNIQUE id (id); #oke
ALTER TABLE table1 CHANGE id id BIGINT UNSIGNED not null AUTO_INCREMENT;
OOPS: Duplicate entry '1' for key 1
Best regards,
Bas