Wednesday, January 28, 2009

MySQL: GROUP BY on datetime column

SELECT DATE_FORMAT(MyDate, '%d %M %Y') AS Date, COUNT(*) AS numRows
FROM Table1 GROUP BY Date;

No comments: