Answer the question
In order to leave comments, you need to log in
Reassign id in table?
There is a task to reassign all IDs in the table, as a result I found the following code:
set @i := -1;
update tablename set id = (@i := @i+1 ) order by id;
Answer the question
In order to leave comments, you need to log in
In principle, a bad idea, but if you really want to, then delete the Id column and create it again
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question