Answer the question
In order to leave comments, you need to log in
Where is the error in the request?
There is a table (pictured). The task is to find the total purchases for a certain month.
I made this request, but it doesn't work. Please tell me where to correct it.
SELECT goods.purchase_date, SUM(price), MONTH(purchase_date) AS mont
FROM goods
GROUP BY mont
Answer the question
In order to leave comments, you need to log in
SELECT MONTH(purchase_date) AS mont, SUM(price) AS goods_sum
FROM goods
GROUP BY MONTH(purchase_date)
SELECT YEAR(purchase_date) AS goods_year,
MONTH(purchase_date) AS goods_month,
SUM(price) AS goods_sum
FROM goods
GROUP BY YEAR(purchase_date), MONTH(purchase_date)
ORDER BY 1, 2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question