当前位置: 代码迷 >> SQL >> oracle字符转换时间SQL话语
  详细解决方案

oracle字符转换时间SQL话语

热度:129   发布时间:2016-05-05 15:01:21.0
oracle字符转换时间SQL语句

?数据库中的时间字段 都存成20110412193421 这种格式? 要转换成2011-04-12 19:34:21 这种格式

?

使用了

update m_pd_log t set t.currtime=(substr(t.currtime,0,4)||'-'||substr(t.currtime,5,2)||'-'||substr(t.currtime,7,2)||' '||substr(t.currtime,9,2)||':'||substr(t.currtime,11,2)||':'||substr(t.currtime,13,2) )

这条语句实现了操作。

  相关解决方案