I have a column where there are slight differences in each name but I want to only use one of the names. I have using an update query but is there an easier way instead of doing an update query one by one? Examples below. There are multiple versions of the name and I only want to pick the first one.
Name
- NORTH HOSP
- NORTH HOSPITAL
- NORTHERN W HOSP
- NORTHERN WEST HOSPITAL
- NORTHERN W HOSPITAL
- BROTHERS MED CTR
- BROTHERS MEDICAL CENTER
- HEALTHALLY HOSP
- HEALTH ALLY HOSPITAL
Current code example:
update #tablename
set name='NORTH HOSP'
where name in ('NORTH HOSPITAL')
update #tablename
set name='HEALTHALLY HOSP'
where name in ('HEALTH ALLY HOSPITAL')