select
date_format(date,'%Y-%m-%d') as day,count(1) as counts
from
message
where
date_format(date,'%Y-%m-%d') between 1979-00-00 and 2008-00-00
group by
date_format(date,'%Y-%m-%d');
SELECT
COUNT(1) AS counts,
week(date) as week
FROM
message
where
date_format(date,'%Y-%m-%d') between 1979-00-00 and 2008-00-00
GROUP BY
week(date)