I have the following table in MySQL:
|id|user|line|
|10|0001| |
|11|0001| |
|12|0002| |
|13|0003| |
|14|0003| |
|15|0003| |
I need to update the line column to be an incrementing number that resets for each user so I woudl end up with this:
|id|user|line|
|10|0001| 1|
|11|0001| 2|
|12|0002| 1|
|13|0003| 1|
|14|0003| 2|
|15|0003| 3|
I've used ROW_NUMBER() OVER (PARTITION...
for this in MS SQL in the past. Is there a way to do this in MySQL?