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