글쎄, 당신은 아마 이미이 문제를 해결하지만 다음 사람을 위해 그것을 답변 해 드리겠습니다.
개인적으로 단순히 다른 열을 만들 것입니다. 데이터베이스의 "더미"열이거나 데이터의 "월"부분을 차지하는 데이터 개체의 클라이언트 쪽일 수 있습니다. 나는 전에 이와 같은 보고서를 작성했는데, 보고서를 디자인 할 때 얼마나 많은 버킷이 있는지 알지 못해서 범위를 모른다면 악취가 난다. 때로는
내가 저장 프로 시저를하고 백 엔드의 데이터를 평평하지만, 간단하지만 덜 유연한 방법은 같은 데이터의 월 부분을 잡아하는 것입니다
select sum(col1), max(col2), to_char(expenditure_date, 'MONTH') as exp_month
from your_table
where you are happy
group by to_char(expenditure_date, 'MONTH)
or
select col1, col2, mid(to_char(exp_date, 'mm/dd/yyyy')1,2) as month_mm
from your_table
where everyone is happy
// then group on the month dummy col and you can do collating/summing on the client report as well.
을