SQL Developer is returning only the date, not the time. How do I fix this?

后端 未结 7 1015
粉色の甜心
粉色の甜心 2020-12-22 16:08

Here\'s what SQL Develoepr is giving me, both in the results window and when I export:

CREATION_TIME       
------------------- 
27-SEP-12
27-SEP-12
27-SEP-1         


        
7条回答
  •  旧巷少年郎
    2020-12-22 16:57

    This will get you the hours, minutes and second. hey presto.

    select
      to_char(CREATION_TIME,'RRRR') year, 
      to_char(CREATION_TIME,'MM') MONTH, 
      to_char(CREATION_TIME,'DD') DAY, 
      to_char(CREATION_TIME,'HH:MM:SS') TIME,
      sum(bytes) Bytes 
    from 
      v$datafile 
    group by 
      to_char(CREATION_TIME,'RRRR'), 
      to_char(CREATION_TIME,'MM'), 
      to_char(CREATION_TIME,'DD'), 
      to_char(CREATION_TIME,'HH:MM:SS') 
     ORDER BY 1, 2; 
    

提交回复
热议问题