我想在一个查询中获得2行2个独立表的总和。 我试过这个:
SELECT SUM(Items.Price) AS [Total Items], SUM(Stores.Cash) AS [Total Cash]
FROM Items, Stores
但是,查询返回商品的数量*商店数和商店总现金数*项数。出了什么问题?
答案 0 :(得分:6)
SELECT SUM(Price) AS [Total Items]
, (SELECT SUM(Cash) AS [Total Cash] FROM Stores)
FROM Items