select c1,(case
when length(c1)=18 then to_date(substr(c1,7,8),'yyyymmdd')
when length(c1)=15 then to_date(substr(c1,7,6),'rrmmdd')
else ''
end)
from test3
when length(c1)=18 then to_date(substr(c1,7,8),'yyyymmdd')
when length(c1)=15 then to_date(substr(c1,7,6),'rrmmdd')
else ''
end)
from test3
解决方案 »
- 为什么 pl/sql desc 不能用 还有 就是每次create 表老报错 说缺失右括号
- 创建数据库失败
- 游标重复返回
- 怎样将字符串str 123;345;678字符串转成in()里面需要的形式
- 触发器编译出错
- 如何检索出来所有有数据的表?(在线等)
- oracle里面的列名如果是小写的话,他会在这个列名两边加引号,这个是正常的吗
- 创建表的问题
- oracleDBA宝典(PDF)哪里有下载??
- 请问:类似于select id,isnull(name,'test') from table where....在oracle 中怎么写?
- oracleDBA宝典(PDF)哪里有下载??
- 救命呀,为什么我的Oracle9i随便输入一个用户名和密码就能以SYSDBA登陆???
insert into idcard values('xxx105197806258819');
insert into idcard values('xxx105780625881');
SQL> select to_date(decode(length(trim(id)),15,'19'||substr(id,7,6),substr(id,7,8)),'yyyymmdd') from idcard;TO_DATE(DE
----------
25-6月 -78
25-6月 -78