I have the following table: MyTable(id, group_column, column_to_fill)
Currently 'column_to_fill' is empty and I want to fill it with increasing integers. The values should start from 0 for every value of group_column.
My table looks like this:
+-----------------------------------+------------+----------------+
| id |group_column| column_to_fill |
+-----------------------------------+------------+----------------+
| 9b71dd5c-d8a6-461c-b1f3-af1e4b1d | Value1 | null |
| 38886977-0f34-4059-b192-f94f5aed | Value1 | null |
| d98e16da-a919-4242-baf8-dbbef636 | Value2 | null |
| e1ab88a9-3307-49a6-b37d-72cdb5da | Value2 | null |
| 75174dcb-eb74-4c13-80a1-1b21905d | Value2 | null |
+-----------------------------------+------------+----------------+
I want it to look like this:
+-----------------------------------+------------+----------------+
| id |group_column| column_to_fill |
+-----------------------------------+------------+----------------+
| 9b71dd5c-d8a6-461c-b1f3-af1e4b1d | Value1 | 0 |
| 38886977-0f34-4059-b192-f94f5aed | Value1 | 1 |
| d98e16da-a919-4242-baf8-dbbef636 | Value2 | 0 |
| e1ab88a9-3307-49a6-b37d-72cdb5da | Value2 | 1 |
| 75174dcb-eb74-4c13-80a1-1b21905d | Value2 | 2 |
+-----------------------------------+------------+----------------+
How can I update it in MySQL?