일별 통계

SELECT DATE(RegDate), COUNT(Id) FROM Table GROUP BY DATE(RegDate);

월별 통계

SELECT DATE_FORMAT(RegDate, '%Y-%m'), COUNT(Id) FROM Table GROUP BY DATE_FORMAT(RegDate, '%Y-%m');

년별 통계

SELECT DATE_FORMAT(RegDate, '%Y'), COUNT(Id) FROM Table GROUP BY DATE_FORMAT(RegDate, '%Y');


또는


select YEAR(RegDate), count(Id) from Table group by YEAR(RegDate);

+ Recent posts