sqlreplace函數
發布時間: 2023-09-10 02:47:37
使用replace函數:
函數語法:replace(列名稱,'被替換的字元','替換的字元')
updatetablea=replace(a,'(','(')--把表tablea列的半形括弧修改為全形括弧
『貳』 sql server replace 函數使用方法
分兩步:
一:先把要改變的列都轉換成正確的,也就是負號在前面
update tabel1 set field1='-'+replace(field1,'-','')
二:把更新完的列轉變為數字型的,在企業管理器里,表設計界面改比較方便
或者 alter table table1 ALTER COLUMN field1 numeric(5)
熱點內容