I have a table with an auto-increasing column. I need to set one of the lines to 1000 and never touch it again, but now that I set it to 1000, auto increment continues to start at 1001 and refuses to start at 1. Is there any way around this?
You can not:
To change the value of the AUTO_INCREMENT counter that will be used for newlines, do the following:ALTER TABLE t2 AUTO_INCREMENT = value;reset , . MyISAM, AUTO_INCREMENT, reset . InnoDB, , , .
To change the value of the AUTO_INCREMENT counter that will be used for newlines, do the following:
ALTER TABLE t2 AUTO_INCREMENT = value;
reset , . MyISAM, AUTO_INCREMENT, reset . InnoDB, , , .
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
: .
, , 1 1000 ? - " " -error.
, , , 0? , 1000, , 1001?
, 1000, , :
UPDATE table.column SET id = 1000 WHERE id = current_id;
id - . current_id , .
MS Access, MySQL , MS Access Excel (-, Excel).
:
UPDATE tbl SET id=1000 WHERE id=current_id; ALTER TABLE tbl AUTO_INCREMENT=1001;