첫댓글SELECT a.ProductID,b.ProductName,c.CategoryID,c.CategoryName,count(d.OrderID) as totalOrder from order_details a join products b on a.ProductID = b.ProductID join categories c on b.CategoryID=c.CategoryID join mydb.order d on a.OrderID = d.OrderID group by a.ProductID;
첫댓글 SELECT a.ProductID,b.ProductName,c.CategoryID,c.CategoryName,count(d.OrderID) as totalOrder
from order_details a
join products b on a.ProductID = b.ProductID
join categories c on b.CategoryID=c.CategoryID
join mydb.order d on a.OrderID = d.OrderID
group by a.ProductID;