What could be the consequence of inserting "id" into any autoincrement table "id" that contains the table?

What can be the consequence of inserting "id" into any file with an auto-incrementing "id" containing a table?

If I have a Tabe in which I configured the "id" column to be automatic incrmented, But still I use an INSERT query that defines the id, like wise INSERT INTO XYZ (id) values ('26');

How will this affect the table and the process associated with it. Aren't these "problems"? or should it be avoided?

+2


a source to share


1 answer


You can do this if you need to. The table keeps track of what is in the number AUTO_INCREMENT

, and if you insert a number equal to or greater than that number, then MySQL adjusts the value accordingly AUTO_INCREMENT

.



Basically, inserts always start at the highest auto_increment id + 1, and you can insert specific ids without issue.

+1


a source







All Articles