I have this:
ID Num
1 KP2
2 KP3
3 KP2
4 KP3
5 KP3
I need to get this:
ID Num
1 KP2
2 KP3
1 KP2
2 KP3
2 KP3
I tried this:
UPDATE t
SET ID = t2.ID
FROM table t JOIN table t2 ON t.Num = t2.Num
This does not work though. Nothing is changes It says that rows were updated, but IDS are still the same.
How about this:
Having said that, the name “ID” sort of suggests primary key. Are you sure this is what you want?