What if you don't delete the record?
The other alternatives I see are: a very complex variable with a list of deleted ids; or to dynamically generate a table will all ids until "table length +1", join, and search for the holes.
- Use the auto-increment to get all the ids sequential.
- Create an isDeleted attribute to mark the ones deleted (instead of really deleting them)
- Query for the first isDeleted in table and Update record.
The other alternatives I see are: a very complex variable with a list of deleted ids; or to dynamically generate a table will all ids until "table length +1", join, and search for the holes.