Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在一个查询中获得 2 个单独表的 2 行的总和。我试过这个:
SELECT SUM(Items.Price) AS [Total Items], SUM(Stores.Cash) AS [Total Cash] FROM Items, Stores
但是,查询返回价格 * 商店数量和商店现金总额 * 商品数量的总和。什么地方出了错?
SELECT SUM(Price) AS [Total Items] , (SELECT SUM(Cash) AS [Total Cash] FROM Stores) FROM Items