0
When I create a table with the column "Id int not null auto_increment" and enter values in the table, after deleting the values and reinserting them, the Id does not part of 1, and sometimes with a random order. And besides appearing 8 Row(s) affected Records, it also appears 8 Duplicates, even though the values have already been deleted from the table. Could someone help me restore my 1 id after restarting the table?
I understood that I can give: alter table games auto_increment=1, but how can I do this if I delete an id in the middle of the others to organize them again?
– Rafael Scherer
The
id
never reorganizes, if you want to clean the table completely, including theauto_increment
, use the commandTRUNCATE TABLE nome_da_sua_tabela;
. Remember that this command clears all table data.– Roberto de Campos
Avoid posting code images. Give preference to post the code itself, so the person can test and find the best solution. [mcve]
– Valdeir Psr
Okay, thank you very much.
– Rafael Scherer