1、计算每个月的第一天的count(*)
select p_day as subDay,count(*) sumCount from t_app_sbd
where p_day>=20200201 and substr(p_day,7,8)='01' group by p_day limit 10
2、计算每周的第一天的count(*)
select p_day as subDay,count(*) sumCount from t_app_sbd
where p_day>=20200201 and pmod(datediff(to_date( date),’1900-01-08’),7)=0
group by p_day limit 10