I have a MySQL table with position key (65,000 records). I deleted, updated some rows in the middle of the table. Now I have, for example, something like this in the position `1 - 6 - 2 - 9`

| id | category | position |
| --- | --- | --- |
| 1 | 1 | 1 |
| 2 | 1 | 6 |
| 3 | 2 | 2 |
| 4 | 2 | 9 |

I want to reset / reorder the position key

| id | category | position |
| --- | --- | --- |
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 2 | 1 |
| 4 | 2 | 2 |

How can I reset position where category = 1
and where category = 2?