Re: insert 0 when combing tables?
Good job for the way you posted your question. ;-) Something like this is what you're looking for:
select category,
sum(case month(date) when 8 then cost else 0 end) August,
sum(case month(date) when 9 then cost else 0 end) September,
sum(cost) Total
from transactions
group by category;
HTH,
Chad
Subject
Written By
Posted
September 24, 2010 03:41PM
Re: insert 0 when combing tables?
September 24, 2010 04:21PM
September 26, 2010 10:11AM
September 26, 2010 12:10PM
September 26, 2010 12:43PM
September 26, 2010 02:49PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.