Group by month and year in MySQL December 8, 2022 by Tarik GROUP BY YEAR(t.summaryDateTime), MONTH(t.summaryDateTime); is what you want.