2009-10-08 12 views

risposta

9

Se la tabella esiste già, si può fare questo:

ALTER TABLE mytable AUTO_INCREMENT = 1000; 

Ma assicurarsi che il valore più alto nella colonna AUTO_INCREMENT è inferiore a 1000.

Se si sta creando una nuova tabella, è può fare questo:

CREATE TABLE mytable (id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT) 
AUTO_INCREMENT = 1000; 
14

Per impostare quando si crea il tuo tavolo:

CREATE TABLE xxx(...) AUTO_INCREMENT = 1000; 

Per impostare dopo la creazione della tabella:

ALTER TABLE xxx AUTO_INCREMENT = 1000; 
Problemi correlati