I have following schema
Table: Product
Columns :
Product_ID
Product_Name
Table: Sales_Detail
Columns :
Sales_Detail_ID
Product_ID
Quantity
Total_Sales
..
..
What I want to do is to show the daily sales using the following query.
SELECT Prouduct_ID, SUM(sd.Quantity), SUM(sd.Selling_Rate) FROM SalesDetail sd WHERE DATE(Date_Time)=CURDATE() GROUP BY Product_ID
And get the product name and product id from the result. How do I do that. I went through resources in the internet but non could help me to come to a correct way of doing it.