季度sql实例:
select CONCAT(YEAR(FROM_UNIXTIME(ref_date)), "-", QUARTER(FROM_UNIXTIME(ref_date))) as date, SUM(visit_uv) as count from `daily_summary` where `ref_date` > 1672502400 and `ref_date` between 1672502400 and 1680278400 group by `date` order by `date` asc
月度sql示例:
select DATE(FROM_UNIXTIME(ref_date)) as date, SUM(visit_uv) as count from `daily_summary` where `ref_date` > 1672502400 and `ref_date` between 1672502400 and 1680278400 group by `date` order by `date` asc