直接上代码:
select CREATED_DATE,COUNT(*) as day_count
from tb
where DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(CREATED_DATE) and USER_ID='OSIW23938271'
group by date_format(CREATED_DATE,'%d') ORDER BY CREATED_DATE ASC;select CREATED_DATE,COUNT(*) as day_co