I have a database with records of M +2, the problem is: I had to delete about 10 000, and now I got this problem, the IDs will be missing, eg
ID: 100
ID: 102
ID: 103
...
How to organize this? That is, replace all subsequent IDs for no “holes” with this? Remember, I have more than 2 million records (15,000 more per day), manually is not feasible.
I Need:
ID: 101
ID: 102
ID: 103
...
You may find that storing all of the records in a source table, then
INSERTthose into a secondary table once you’re sure which ones qualify. This is usually pretty easy:If you have an auto-increment ID field you just leave it out of both sides and it will re-create it on the
b_tableside, sequentially, no gaps. You can purge records froma_tablewhen you’re done with them if you like.