-- 按周进行统计
select concat_ws(',',year(createDate),week(createDate)) as weekflg, count(*) as cnt from t_operate_log
where
createDate<='2015-2-21' and createDate>='2013-1-09'
-- year(createDate)=2015
group by weekflg
-- 按日进行统计
select date(createDate) as weekflg, count(*) as cnt from t_operate_log
where
createDate<='2015-1-11' and createDate>='2015-1-09'
group by weekflg
select concat_ws(',',year(createDate),week(createDate)) as weekflg, count(*) as cnt from t_operate_log
where
createDate<='2015-2-21' and createDate>='2013-1-09'
-- year(createDate)=2015
group by weekflg
-- 按日进行统计
select date(createDate) as weekflg, count(*) as cnt from t_operate_log
where
createDate<='2015-1-11' and createDate>='2015-1-09'
group by weekflg