I have the following data in a table:
Id | InventoryId | RevisionId
-----------------------------------
1001 | 1234 | 1
1002 | 2235 | 1
1003 | 2235 | 2
1004 | 2235 | 2
1005 | 2235 | 3
1006 | 2235 | 4
1007 | 3234 | 1
1008 | 3234 | 2
1009 | 3234 | 3
1010 | 3234 | 3
1011 | 3234 | 4
1012 | 3234 | 5
1013 | 3234 | 5
1014 | 3234 | 6
I want to write a script which provide me data correction in following way
Id | InventoryId | RevisionId
---------------------------------
1001 | 1234 | 1
1002 | 2235 | 1
1003 | 2235 | 2
1004 | 2235 | 3
1005 | 2235 | 4
1006 | 2235 | 5
1007 | 3234 | 1
1008 | 3234 | 2
1009 | 3234 | 3
1010 | 3234 | 4
1011 | 3234 | 5
1012 | 3234 | 6
1013 | 3234 | 7
1014 | 3234 | 8
Can we do this with a SQL script?
Any suggestions?