On my previous post, we used the SUM function to calculate the TotalSales in a store. What if we want to display the TotalSales by PRODUCT? Below is the SALES table that we will used in our query.
SALES |
Query Group By
SELECT product,SUM(total) FROM sales group by product
Output Group By
First, the query will group all the same products and calculate the sum of the total column.
Feel free to post a comment below if you have questions in mind. Good day and God bless! ^_^
No comments:
Post a Comment