I have been trying the following query using group by and inner join clause in asp.net:
SELECT tblVendorItem.Name AS Product,
tblEventItem.Quantity * tblEventItem.Price AS Sale
FROM
tblEventService
INNER JOIN tblEventItem ON
tblEventService.EventServiceID = tblEventItem.EventServiceID
INNER JOIN tblVendorItem ON
tblVendorItem.VendorItemID = tblEventItem.VendorItemID
WHERE
(tblEventService.VendorID = 2)
GROUP BY
tblVendorItem.Name, tblEventItem.Quantity, tblEventItem.Price
On executing this, what I get is:
What I really want is, Product should be not repeated and the total sales should come!
For eg: Mercedes 75
Can any one help me out?
I am attaching the database also: