Deniz Demir wrote:
> I have a table having a auto_increment row. I want to make table's rest
> rows' numbers automaticaly change after a row in the middle of table has
> been deleted. Is it possible?
> I have written a perl CGI to delete rows from table, how can I add this
> task to it also?
No, not automatically, but you can use an Update to do what you want:
auto_inc_col = (auto_inc_col -1)
auto_inc_col > deleted_row_id
But you must be absolutely sure, that there are no references in other tables to this
If you use 3.23.xx then you have to correct the actual AUTO_INCREMENT value.
This is necessary, because since 3.23.0 the actual AUTO_INCREMENT value is stored in the
table and not longer evaluated through:
MAX( auto_inc_col ) + 1
PS: Sorry for the late answer, I was really busy.