当前位置: 代码迷 >> Oracle管理 >> 怎么在oracle增加字符
  详细解决方案

怎么在oracle增加字符

热度:8   发布时间:2016-04-24 05:47:50.0
如何在oracle增加字符
我有一个时间的字段,格式是20040304   现在我想变成2004.03.04

请问sql语句怎么写呢?

在sql   server里我会写   如下:
update   jngl_wsda   set   wg22=stuff(wg22,   4,   0,   '. ')   where   len(wg22)=8

但是oracle里面没有substr函数,请问怎么写呢?

------解决方案--------------------
oracle 里面有substr()函数,

你可以试试:
update jngl_wsda set wg22=stustr(wg22,1,4)|| '. '||substr(wg22,5) where len(wg22)=8
  相关解决方案