mysql group by day code example
Example 1: mysql group by day
GROUP BY DATE_FORMAT(record_date, '%Y%m')
Example 2: mysql group by date
SELECT SUM(foo), DATE(mydate) FROM a_table GROUP BY DATE(a_table.mydate);
Example 3: mysql group by day
GROUP BY DATE_FORMAT(created_at, '%Y%m%d')