I have a table with information about sold products, the customer, the date of the purchase and summary of sold units.
The result I am trying to get should be 4 rows
I would go with the following
SELECT SUM(totalprice), year(date), month(date) FROM sales GROUP BY year(date), month(date)