Stworzyłem tabelę w MySQL z kolumną itemID
. Po utworzeniu tabeli, teraz chcę zmienić tę kolumnę na AUTOINCREMENT
. Jak to zrobić za pomocą instrukcji ALTER?ALTER table - dodanie AUTOINCREMENT w MySQL
definicja Tabela:
ALLITEMS (itemid int(10) unsigned, itemname varchar(50))
używam następujący kod, ale to jest rzucanie error: syntax nieprawidłowe.
ALTER TABLE allitems
MODIFY itemid INT(10) UNSIGNED AUTOINCREMENT;
Duplikat: http://stackoverflow.com/questions/4795382/mysql-add-auto-increment-to-primary-key – lepe
'AUTOINCREMENT' ma podkreślenia:' AUTO_INCREMENT' .... – Pacerier