SELECT

to_char(datetime, 'YYYY'), to_char(datetime, 'MM'), to_char(datetime, 'DD'),

to_char(datetime, 'HH24'), to_char(datetime, 'MI'), sum(column)


FROM TABLE WHERE 조건


GROUP BY

to_char(datetime, 'YYYY'), to_char(datetime, 'MM'), to_char(datetime, 'DD'),

to_char(datetime, 'HH24'), to_char(datetime, 'MI')

ORDER BY to_char(datetime, 'YYYY') ;