Facebook
From Ample Zebra, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 229
  1. SELECT c.CustomerID, od.OrderID, SUM(Quantity) AS `ilosc towarow`
  2. FROM Customers AS c
  3. LEFT JOIN Orders AS o
  4. ON c.CustomerID=o.CustomerID
  5. JOIN order_details AS od
  6. ON o.OrderID=od.OrderID
  7. WHERE c.CustomerID='ANATR'
  8. GROUP BY od.OrderID
  9. ORDER BY c.CustomerID