进行两次类型转换
一次是char转成date
然后再把date转成char
select to_char(to_date('071000','hh24miss'),'hh24:mi:ss') from dual;
直接执行上句即可
你的这个071000是什么类型的,若是字符型的:
select substr('071000',1,2)||':'||substr('071000',3,2)||':'||substr('071000',5,2) from dual;
若是数字型的:
select substr(to_char(071000),1,2)||':'||substr(to_char(071000),3,2)||':'||substr(to_char(071000),5,2) from dual;
select substr('071000',1,2)||':'||substr('071000',3,2)||':'||substr('071000',5,2) from dual;