展开全部
1、创建测试表,
create table test_date_conv(id varchar2(20),v_date varchar2(200));
2、插入32313133353236313431303231363533e78988e69d8331333433623061测试数据;
insert into test_date_conv values(1, 20190101122359);
insert into test_date_conv values(2, 20190115132359);
insert into test_date_conv values(3, 20190125052359);
insert into test_date_conv values(4, 20190125122359);
insert into test_date_conv values(5, 2019013119359);
commit;
3、查询表中全量数据;select t.*, rowid from test_date_conv t;
4、编写语句,转换成成YYYY-MM-DD HH:mm:ss格式;
select t.*, to_char(to_date(v_date,’yyyymmddhh24miss’),’yyyy-mm-dd hh24:mi:ss’) v2 sec from test_date_conv t;