Posted on: 7/23/2012 5:58:08 AM | Views : 271

Hi dear ,
how can i grouping results below statement : 
SELECT     O.IdBook, COUNT(O.IdBook) * O.Quantity AS noOfBooks
FROM         dbo.tblOrderDetail AS O INNER JOIN
                      dbo.tblInvoice AS I ON O.IdOrder = I.IdOrder
WHERE     (I.IsPay = 1)
GROUP BY O.IdBook, O.Quantity
result of statement up is:
in result we have two 5 in id book ,I want it show one 5 and in quantity show sum of 2+3
Please help,
idbook  -- Quantity
1 2 Go to the complete details ...