1、如device表中的identity欄位正常的欄位長度是32位,但是某些不正常的數據,後面多出空格,需要去掉後面的空格,可執行以下命令: 2、使用substring函數截取某欄位的的其中一部分的方法,如截取identity第21位及其之後的數據,並保存位identity12欄位: ...
1、如device表中的identity欄位正常的欄位長度是32位,但是某些不正常的數據,後面多出空格,需要去掉後面的空格,可執行以下命令:
1 select * from device where length(identity)=33; 2 update device set identity=trim(identity) where length(identity)=33;
2、使用substring函數截取某欄位的的其中一部分的方法,如截取identity第21位及其之後的數據,並保存位identity12欄位:
1 update device set identity12=substring(identity,21);