|
MySQL Auto_increment
Is there a way to make auto_increment increment from the highest value in a column (not counting deleted entries)?
This is what happens now: I have a table with the ID column having auto_increment.
I create an entry. ID = 1.
I create another entry. ID = 2.
I delete entry 2.
I create another entry. ID = 3.
I end up with ID 1 and 3.
This is what I want to happen:
I create an entry. ID = 1.
I create another entry. ID = 2.
I delete entry 2.
I create another entry. ID = 2.
I end up with ID 1 and 2.
Is there something simple that will make this happen?
|