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;

 

以上就是处理今天遇到的问题。

相关文章
相关标签/搜索