Home All Groups Group Topic Archive Search About

SQL Include Empty Months

Author
9 Apr 2007 6:34 PM
labsRcool@community.nospan
I am grouping total orders per month. Currently, as an example, I am able to
get the following results.
January     25
March       15
May          10
....
The problem is when there are no orders in a month.Currently, the months
with zero orders do not show up. I would rather have "empty months" still
display with zero, like...
January   25
February  0
March      15
April         0
May         10
June         0
....
What is the best method for displaying my desired result?
My first thought is having a "months table" and outer-joining. Is there a
better method without creating a "months" table"?

AddThis Social Bookmark Button