Answer the question
In order to leave comments, you need to log in
How to group by date range in MySQL?
Greetings. Tell me how to group by date range in MySQL, for example, we take a date segment of 4 days, and group by it. Now I know how to group by day, month, week using DATE_FORMAT
SELECT DATE_FORMAT(datetime, "%d.%m.%Y") as `date`, `name`, SUM(value) AS `sum_val` FROM `log` GROUP BY `date`,`name`
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question