oracle 批量修改时间字段的格式

--批量修改09/10  为2016/09/10
update bt_nm_evaluation1 s set ev_time='2016/'||substr(ev_time,0)   where length(ev_time)=9 ;

--批量修改201601/02  为 2016/01/02
update bt_nm_evaluation1 s set ev_time=substr(ev_time,0,4) ||'/'||substr(ev_time,5)   where length(ev_time)=9 ;

--批量替换
update a_a_nm_evment_12 a set a.ev_time=replace(ev_time,'-','/') where  ev_time like '%2016-12-%'

猜你喜欢

转载自st4024589553.iteye.com/blog/2340765