select O.OrderID, (select distinct (count( D.OrderID)) from Orders D where D.OrderID = O.OrderID group by D.OrderID )'ProductQuantity' from OrderDetails O group by OrderID, ProductID;
It is showing the result as below but the predicted result is
10248 1 10248 3
10248 1 10249 2
and so on it must be select clause and the count must be in select clause.