Date change in sql

hi I have a date that is 2009-06-02 00: 00: 00.000, and I only want a monthly group.

how to change this ?!

+3
source share
3 answers

You can group by month, but have data that spans more than one year. In this case, I would do:

group by Year(MyDate), Month(MyDate)
+2
source

using

group by MONTH(record_date)

see this question for more information:

MySQL Query GROUP BY day / month / year

0
source
SELECT ... GROUP BY MONTH(datecolumn)
0
source

Source: https://habr.com/ru/post/1731239/


All Articles