create table #t ( f1 varchar(10) ) insert into #t select '吨' union all select '吨' union all select '吨' union all select '千米' union all select '台'update #t set f1=replace(f1,'吨','米')select *from #tf1 ---------- 米 米 米 千米 台(5 row(s) affected)
update tb set col=replace(col, '吨', '米') where charindex('吨', col)>0
(
f1 varchar(10)
)
insert into #t
select '吨' union all
select '吨' union all
select '吨' union all
select '千米' union all
select '台'update #t
set f1=replace(f1,'吨','米')select *from #tf1
----------
米
米
米
千米
台(5 row(s) affected)
set col=replace(col, '吨', '米')
where charindex('吨', col)>0