I have a table where it contains a column that has no auto-increment.
When I delete a record some gaps appear and I would like to fill those. Specifically I would like to find the lowest number and start from that one and change every row to has its next starting from 4. (I do not care of the order for the numbers lower or equal to 3). Below is an example of how I would like the column to look after the UPDATE.
+---+ +---+
| 1 | | 1 |
+---+ +---+
| 4 | | 4 |
+---+ +---+
| 9 | | 5 |
+---+ -> +---+
|10 | | 6 |
+---+ +---+
|11 | | 7 |
+---+ +---+
|15 | | 8 |
+---+ +---+
If possible I would like to do that with one query since the rows might be two or three hundred and I wouldnt want to loop through so many.