How to Display total sales made per product

How to Display total sales made per product, Here is the query and out put.

SQL Query for Display total sales made per product

select  P.ProductName, sum (P.ProductCost) as Total, 
		count (*) as NumberOfItemSold 
		from tblProductCustomer as PC 
		inner join tblCustomer as C ON  PC.CustomerId_fk=C.CustomerId
		inner join tblProduct as P ON PC.Productid_fk = P.ProductId
		group by p.ProductName

Leave a Comment