我有以下问题:
我有两张表,一张用于客户购买的商品,另一张用于员工销售:
Table 1 (Emp)
EmpId
ProductId
dateSold
Price
Qty
Table 2 (Cust)
CustomerId
ProductId
dateSold
Price
Qty
这样做是我目前正在查询的查询:
SELECT SUM(EmployeeSales.productPrice * EmployeeSales.Qty +
userBoughtItems.ProductPrice * userBoughtItems.qty) AS Total,
EmployeeSales.dateSold,
userBoughtItems.dateSold AS Expr1
FROM EmployeeSales
INNER JOIN userBoughtItems ON EmployeeSales.dateSold = userBoughtItems.dateSold
GROUP BY EmployeeSales.dateSold, userBoughtItems.dateSold
我想在同一日期获得两张桌子的总数......