oracle batch modify the format of the time field

--批量修改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-%'

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326525170&siteId=291194637