oracel去空格解決方法

2021-08-11 12:02:29 字數 718 閱讀 8228

近日資料庫中的a表中出現了空格,用常規的方法去空格無法解決。

常規方法如trim,replace等

update tablename set fileda=trim(fileda);

update tablename set fileda=replace(fileda,' ','');

---tab

update tablename set fileda=replace(fileda,chr(9),'');

---回車

update tablename set fileda=replace(fileda,chr(10),'');

--換行

update tablename set fileda=replace(fileda,chr(9),'');

後面想到可能是由於是其他特殊字元,只是看起來像空格而已,了解了下oracle asscii碼的知識,採用解決方法如下:

首先查出欄位中看起來像空格的資料的asscii碼,然後再進行替換

---14909568

select ascii(' ') from dual;

update tablename set fileda=replace(fileda,chr(14909568),'')

提交後問題解決,類似這樣看起來像空格實際不是空格的問題都可以這樣處理。

SQL 字串去空格解決方法

一 表中字串帶空格的原因 1,空格就是空格。2,控制符 顯示為 空格。二 解決方法 第一種情況,去空格的處理的比較簡單,replace column,就可以解決。第二種情況,解決方法就比較麻煩點 需要先查出相應的ascii碼,再用replace column,char ascii碼 解決,以下舉個栗...

亂碼解決方法

jsp頁面顯示亂碼 pageencoding utf 8 servlet頁面顯示亂碼 在response輸出內容之前,執行response.setcontenttype text html charset utf 8 post表單傳遞引數亂碼 通過jsp頁面 html頁面或者servlet中的表單元...

usr bin ld lc解決方法

背景 使用海思交叉編譯器編譯庫檔案中出現。原因 ld表示連線,lc表示需要連線libc.a。出現這個,說明缺少需要的libc.a檔案。解決過程 剛開始以為是海思交叉編譯器的問題,便在安裝目錄find libc.a,找到很多個,排除這個原因 然後檢查路徑問題,發現路徑也沒問題。回想一下,虛擬機器是mi...