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') ;
'DB & SQL & web' 카테고리의 다른 글
[PostgreSQL] LOCK TABLE table_name IN ACCESS EXCLUSIVE MODE; (0) | 2014.04.19 |
---|---|
[jsp:문법] 예외 처리 finally (0) | 2014.04.15 |
[jsp] 하위 디렉토리 포함하여 파일 목록 구하기. (0) | 2014.02.04 |
[PostgreSQL] 백업 & 복구 & CREATE DATABASE COPY (0) | 2013.09.15 |
[PostgreSQL] 외부 DATABASE 연결. (0) | 2013.08.13 |