Oracle的數據更新操做

根據字段長度篩選符合條件的數據:table

select tbID from tablename where length(tbID)=2date

在字段前添加0補齊3位:select

select lpad(tbID,3,'0') from tablename數據

更新字段值:tab

update tablename set tbID=lpad(tbID,3,'0') where length(tbID)=2ab

 

同上,若是是1位更新爲3位前面補0;

 

以上就是處理今天遇到的問題。

相關文章
相關標籤/搜索