UPDATED:
I have some table with sync_numbers, like this:
---------------------
id | sync_number
---------------------
1 | 1
2 | 1
3 | 1
4 | 1
now I want to set sync_number to its maximum value + 1 but do this for each row, like this:
---------------------
id | sync_number
---------------------
1 | 2
2 | 3
3 | 4
4 | 5
How can I do this?
I’ve tried to do something like this:
UPDATE u_shop SET sync_number = ((SELECT selected_value FROM (SELECT MAX(sync_number) AS selected_value FROM u_shop) AS sub_selected_value) + 1);
but this places the same values to all rows which is not that I need.
This should work: