Here is my table:
ID | MainLink
----------------------
1 | 1111
2 | 1111
3 | 2222
4 | 3333
5 | 2222
6 | 4444
I need to be able to select and replace the ID value based on a distinct value from the MainLink Column. The new value for the ID Column will have to be the first ID value found. This is what I would like:
ID | MainLink
----------------------
1 | 1111
1 | 1111
3 | 2222
4 | 3333
3 | 2222
6 | 4444
Hope this is clear. Thank you for any help.
IDa primary key?GROUP BYonMainLink, aMIN(ID)and aCOUNT(*). Duplicate rows seem like a waste.Yes, ID is a primary key.you can't replace it.You can't have same value twice