Total number of items purchased by each customer or number of orders (assuming one row = one order) by each customer?
Code: Select all
SELECT CustomerID, SUM(Quantity)
FROM Orders
GROUP BY CustomerID;
or
Code: Select all
SELECT CustomerID, COUNT(*)
FROM Orders
GROUP BY CustomerID;