How to select product category even it has zero sales volume?
Posted by: Jack Luk
Date: August 14, 2013 12:23AM

String str = "SELECT S.ProductName,"
                + " S.items_total_sales AS 'Total Sales'" // each product sum of sales by money so sum
                + " from"
                    + " ((SELECT products.ProductName, "
                    + " sum(products.UnitPrice * order_details.Discount * order_details.Quantity) AS items_total_sales "
                    + " from (products AS products "
                    + " RIGHT JOIN order_details AS order_details ON (products.ProductID = order_details.ProductID))"
                    + " GROUP BY products.ProductName) AS S) ";
Some products with zero sales are not shown here
Thanks
Jack

Options: ReplyQuote


Subject
Written By
Posted
How to select product category even it has zero sales volume?
August 14, 2013 12:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.