I am having a heck of a difficult time with queries involving a one to many relationship. I have one table that contains sku information and one table that contains sales details.
Table 1
Item # Category Excess Units
123 video 100
124 video 50
125 audi 105
Table 2
Item # Location Sales
123 A $1,000
123 B $1,500
123 C $2,000
124 B $500
125 C $1,000
How do I make a query where I get a sum of all the sales by category along with total excess? A sum of category sales has to sum across locations, yet a sum of category excess has to be across items only. Can I do this in a single query, or do I have to run multiple queries?
Table 1
Item # Category Excess Units
123 video 100
124 video 50
125 audi 105
Table 2
Item # Location Sales
123 A $1,000
123 B $1,500
123 C $2,000
124 B $500
125 C $1,000
How do I make a query where I get a sum of all the sales by category along with total excess? A sum of category sales has to sum across locations, yet a sum of category excess has to be across items only. Can I do this in a single query, or do I have to run multiple queries?