Dear All,
I have the below two tables
Customers (customer_id, custer_name,customer_address)
Sales (sales_id, sales_cust_id, sales_order_date, sales_amount)
I need to write the SQL query to display the total sales made by each customer, each month with grand total of all months of current year
can anyone help regarding this..
Sample
| customer_id | customer_name | month | total_sales |
|---|
| 12 | aaa | Jan | 15242 |
| 12 | aaa | Feb | 17889 |
| | (Total) | 33131 |
| 13 | bbb | Feb | 1487 |
| 13 | bbb | Jun | 19987 |
| | (Total) | 21474 |