mysql group date by year and month code example
Example 1: mysql group by day
GROUP BY DATE_FORMAT(record_date, '%Y%m')
Example 2: mysql group by day
GROUP BY DATE_FORMAT(created_at, '%Y%m%d')
GROUP BY DATE_FORMAT(record_date, '%Y%m')
GROUP BY DATE_FORMAT(created_at, '%Y%m%d')