The table name is \"OrderDetails\" and columns are given below:
OrderDetailID || ProductID || ProductName || OrderQuantity
I\'m trying to s
You can try the below query. I assume you have a single table for all your data.
SELECT OD.ProductID, OD.ProductName, CalQ.OrderQuantity
FROM (SELECT DISTINCT ProductID, ProductName
FROM OrderDetails) OD
INNER JOIN (SELECT ProductID, OrderQuantity SUM(OrderQuantity)
FROM OrderDetails
GROUP BY ProductID) CalQ
ON CalQ.ProductID = OD.ProductID