SQL query to compare product sales by month

后端 未结 6 1690
忘掉有多难
忘掉有多难 2021-02-10 07:45

I have a Monthly Status database view I need to build a report based on. The data in the view looks something like this:

Category | Revenue  |  Yearh  |  Month
B         


        
6条回答
  •  别那么骄傲
    2021-02-10 08:40

    I could be wrong but shouldn't you be using a full outer join instead of just a left join? That way you will be getting 'empty' columns from both tables.

    http://en.wikipedia.org/wiki/Join_(SQL)#Full_outer_join

提交回复
热议问题