which item has been sold more than once to the same customer by the same employee ?
Try this:
SELECT ProductID, CustomerID, EmployeeID, COUNT(*) FROM Orders INNER JOIN OrderDetails ON Orders.OrderID = OrderDetails .OrderID GROUP BY ProductID, CustomerID, EmployeeID HAVING COUNT(*) > 1
No comments:
Post a Comment