Haven't tested it, but this might work ...
Code:
select to_char(posting_date,'Mon-YYYY'), sum(amount)
from w_card_transaction
where posting_date > to_date('31-12-2003','DD-MM-YYYY')
and posting_date < to_date('01-01-2005','DD-MM-YYYY')
group by to_char(posting_date,'Mon-YYYY'),Trunc(posting_date,'MON')
order by Trunc(posting_date,'MON');
Alternatively ...
Code:
Select to_char(mth,'Mon-YYYY'),amt
From
(
select Trunc(posting_date,'MON') mth, sum(amount) amt
from w_card_transaction
where posting_date > to_date('31-12-2003','DD-MM-YYYY')
and posting_date < to_date('01-01-2005','DD-MM-YYYY')
group by Trunc(posting_date,'MON')
order by 1
)
Ref DaPi's avatar -- have you ever read "The Picture of Dorian Gray"? 'Nuff said.