should be easy:
I have two tables:
table 1
ID NAME NEWID
1 DOG
2 CAT
3 HORSE
table 2
NAME ID
DOG 100
CAT 200
Horse 300
I need the result to be as follows:
ID NAME NEWID
1 DOG 100
2 CAT 200
3 HORSE 300
My thoughts are:
Update table1
set NewId = (select ID from table2 where Id =NewID)
it says: Invalid column name NewId
Kind of confusing, as it seems you would need to match on name, and not Id? Assuming that is the case: