col test1 for a20
col test2 for a20
col test3 for a20
col test4 for a20
col test5 for a20
col test6 for a20
select
to_char(to_date('05/05' ,'MM/DD') ,'YYYY/MM/DD HH24:MI:SS') as test1,
to_char(to_date('2008' ,'YYYY') ,'YYYY/MM/DD HH24:MI:SS') as test2,
to_char(to_date('2008/05' ,'YYYY/MM') ,'YYYY/MM/DD HH24:MI:SS') as test3,
to_char(to_date('2008/05/05 23:22','YYYY/MM/DD HH24:MI'),'YYYY/MM/DD HH24:MI:SS') as test4,
to_char(to_date('2008/05/05 23' ,'YYYY/MM/DD HH24') ,'YYYY/MM/DD HH24:MI:SS') as test5,
to_char(to_date('2008/05/05' ,'YYYY/MM/DD') ,'YYYY/MM/DD HH24:MI:SS') as test6
from dual;
test1 test2 test3
------------------- ------------------- -------------------
2008/05/05 00:00:00 2008/02/01 00:00:00 2008/05/01 00:00:00
test4 test5 test6
------------------- ------------------- -------------------
2008/05/05 23:22:00 2008/05/05 23:00:00 2008/05/05 00:00:00