oracle中往varchar2格式的字段中插入date时间格式的值会发生什么?
来源:互联网 发布:网上商城美工招聘 编辑:程序博客网 时间:2024/06/04 17:57
--建立表test1
create table TEST1
(
ID VARCHAR2(40) default sys_guid(),
TDATE VARCHAR2(200)
)
tablespace APP_TX_DATA
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
--插入date时间格式数据
insert into test1 values(sys_guid(),sysdate+10);、
--查询数据
select * from test1 -- tdate值为 01-7月 -15
--Q:如何将现有数据01-7月 -15格式刷成正常的YYYYMMDD格式?
update test1 t set t.tdate = '20'||substr(t.tdate,instr(t.tdate, '-', 1, 2) + 1,2)
|| case instr(t.tdate, '月', 1, 1) - (instr(t.tdate, '-', 1, 1) + 1)
when 1 then '0' || substr(t.tdate,
instr(t.tdate, '-', 1, 1) + 1,
(instr(t.tdate, '月', 1, 1)) - (instr(t.tdate, '-', 1, 1) + 1))
when 2 then substr(t.tdate,
instr(t.tdate, '-', 1, 1) + 1,
(instr(t.tdate, '月', 1, 1)) - (instr(t.tdate, '-', 1, 1) + 1))
else t.tdate end
|| substr(t.tdate,0,2)
where t.tdate like '%月%' order by t.tdate
- oracle中往varchar2格式的字段中插入date时间格式的值会发生什么?
- oracle中Date类型字段数据插入格式
- oracle 中插入date类型的字段
- Oracle格式转换(varchar2类型的时间格式转换)
- oracle中date数据类型插入格式
- Oracle中date数据类型插入格式
- Oracle中Date的各种格式转换
- ORACLE中VARCHAR2类型的字段长度
- java 中Date类型的时间显示格式
- java 中Date类型的时间显示格式
- Angularjs中对时间格式:/Date(1448864369815)/ 的处理
- date 中match插件是根据字段的日期格式,采用不同的格式进行转化
- Oracle 中用 update 语句更新date, timestamp字段的格式
- Oracle中查询同一个日期字段,格式不同的问题
- oracle中字段char、varchar和varchar2的区别
- oracle中字段char、varchar和varchar2的区别
- Oracle中字段为varchar2类型的排序......
- java中各种date格式的转化
- java基础<一>
- JNDI到底是什么,有什么作用
- spring mvc 工作原理
- MongoDB管理(1)
- asp.net中DataTable和List<T>之间相互转换
- oracle中往varchar2格式的字段中插入date时间格式的值会发生什么?
- xterm config
- Android开源项目分类汇总
- 国外、国内Hadoop的应用现状
- Spring MVC常用的注解
- Android文件命名规范
- You must SET PASSWORD before executing this statement的解决方法
- iOS 开发使用16进制色值设置颜色
- Python的getattr(),setattr(),delattr(),hasattr()