统计部分:
按周:select DATE_FORMAT(create_time,'%Y%u') weeks,count(caseid) count from tc_casegroupby weeks;
按日: select DATE_FORMAT(create_time,'%Y%m%d') days,count(caseid) count from tc_casegroupby days;
按月: select DATE_FORMAT(create_time,'%Y%m') months,count(caseid) count from tc_casegroupby months;
去重计算总数
select count(distinct(过滤字段)) from table where ...;
待续
新闻热点
疑难解答