Question : sql query using count

hello experts
i am trying to return the total order quantity for each product grouping them by category, but i am unable to make it right

please can you advise how can i go about doing this?

thanks
s
Code Snippet:
1:
2:
3:
4:
5:
SELECT GiftName,  COUNT(Qty) As Quantity, category.catdesc FROM OrdersToProcess 
inner join product on OrdersToProcess.giftname = product.prodname
inner join productcategory on product.prodid = productcategory.prodid
inner join category on productcategory.catid = category.catid
GROUP BY GiftName ORDER BY GiftName

Answer : sql query using count

SELECT GiftName,  SUM(Qty) As Quantity,category.catdesc
FROM OrdersToProcess
inner join product on OrdersToProcess.giftname = product.prodname
inner join productcategory on product.prodid = productcategory.prodid
GROUP BY GiftName,category.catdesc
ORDER BY GiftName
Random Solutions  
 
programming4us programming4us