大家好,我機器安裝的是sql server 7.0,我現需要對sdb這個(gè)表的snum這個(gè)字段中的數據進(jìn)行修改,具體要求如:c20020711這個(gè)字串中的第四位全替換為3,即****2****,改為****3**** 。哪位師兄能幫我寫(xiě)出在sql語(yǔ)句,不勝感激?。?!
另我用
update table_name set
id=concat(Substring(id,1,4),‘3‘,Substring(id,6,length(id))) where id like
‘c2002%‘試過(guò),但提示說(shuō)concat這個(gè)函數未定義。
table:表名。id:字段名
1.update table_name set id=stuff(id,4,1,‘3‘)
2.
update 表 set 某一字段=replace(某一字段,‘2003‘,‘2004‘)
where 某一字段 like ‘%2003%‘ 這樣可以實(shí)現,我試過(guò),已成功解決了,樓上的方法我也去試一下。
聯(lián)系客服