Refer to the screen cap below for sample data. normalizing these data I found these similar codes that mean the same thing as far as my data are concerned. I’m trying to update my table so that the primarycodes on the right are updated to those on the left

The query I used to find these values:
select *
from icd
inner join icd as i2 on i2.primarycodetext=icd.primarycodetext
and i2.primarycode <> icd.primarycode
where icd.primarycode like '%0'
The update query I tried.
update icd
set icd.primarycode=i2.primarycode
from
(
select *
from icd
inner join icd as i2 on i2.primarycodetext=icd.primarycodetext
and i2.primarycode <> icd.primarycode
where icd.primarycode like '%0'
)t
The error received: Msg 8156, Level 16, State 1, Line 12
The column 'primarycode' was specified multiple times for 't'.
EDIT: the only two columns in this table are primarycode and primarycodetext
Ok, for your question as it is, you should do the following:
But you are gonna have duplicates on your table after doing that. Thinking of what you really want to get (unique records for those values), then you should
DELETEthose records instead of updating them: