how to group by year and month but not day in mysql code example Example: mysql group by day GROUP BY DATE_FORMAT(record_date, '%Y%m')