Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- month
- ------------
- month_id -- 1-12
- month_name -- Jan - Dec
- Sales
- ------------
- month_id --not every month has sale
- product
- amount
- select
- month_name
- ,product
- ,sum(isnull(amount,0))
- from
- month
- left outer join sales
- on sales.month_id = month.month_id
- group by
- month_name
- ,product
Add Comment
Please, Sign In to add comment