Reputation: 95
I would like to get the sums of 2 rows of 2 separate tables in one query. I tried this:
SELECT SUM(Items.Price) AS [Total Items], SUM(Stores.Cash) AS [Total Cash]
FROM Items, Stores
However, the query returns the sum of Price * number of stores and total cash in stores * number of items. What went wrong?
Upvotes: 2
Views: 107
Reputation: 61
SELECT SUM(Price) AS [Total Items]
, (SELECT SUM(Cash) AS [Total Cash] FROM Stores)
FROM Items
Upvotes: 6