Answer the question
In order to leave comments, you need to log in
How to add a second autoincrement and populate the field?
There is a completed table. You need to add a field that will be an auto-increment. This field is the second autoincrement in the table and is not a primary key. How (when|after) adding a field to overwrite all the data in the table, and assign the initial value of the field, for example, 100?
Answer the question
In order to leave comments, you need to log in
ALTER TABLE `sometable`
ADD COLUMN `id` INT AUTO_INCREMENT PRIMARY KEY,
AUTO_INCREMENT=100;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question