我有一个如下的问题:
我有两个表1表格供顾客购买物品,另一个表格供雇员销售:
Table 1 (Emp)
EmpId
ProductId
dateSold
Price
Qty
Table 2 (Cust)
CustomerId
ProductId
dateSold
Price
Qty
此时此操作是查询 IM tring :
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
我想在同一天得到两张桌子的总数...