select month year from date mysql and groip by month year code example Example: mysql group by day GROUP BY DATE_FORMAT(record_date, '%Y%m')