update 表 set 字段=replace(字段,substring(cast(字段 as varchar),索引,1),改成的数字) 如果1张表里还有其他条件 在后面加上where ……就ok了假如你的00000字段为a 表名为tableupdate table set a=replace(a,substring(cast(a as varchar),4,1),1)试试吧
用replace方法进行字符串替换,之后用update方法进行记录更新
sql:update tablaname set filename = replace(filename ,'原值','新值');
解释:上面语句的意思就是替换字段filename中的内容,将”原值“替换为”新值“,之后通过update方法更新到数据库tablename表中。
update tab set fld=left(fld,3) & "1" & right(fld,1)