I have the following table
Id Value
1 3
1 12
1 67
2 7
2 99
5 30
5 33
5 4
5 87
5 12
5 1
I want to update it to have this table.
Id UniqueIdBySubSet Value
1 1 3
1 2 12
1 3 67
2 1 7
2 2 99
5 1 30
5 2 33
5 3 4
5 4 87
5 5 12
5 6 1
I found the perfect thread on SO, but that was for mssql. I am using mysql 4.1.10.
Another thread can be found here: Sequence generation for subsets of a table .
Does anyone know how I can do this in mysql?
Thanks Jean-Francois
source
share