mysql group by month and year code example
Example 1: mysql group by day
GROUP BY DATE_FORMAT(record_date, '%Y%m')
Example 2: mysql select month and year
SELECT DATE_FORMAT(test_date,'%Y%m') AS date FROM test_table;
Example 3: mysql group by day
GROUP BY DATE_FORMAT(created_at, '%Y%m%d')