- select DATE_FORMAT(date,‘%Y%u‘) weeks,count(id) count from table group by weeks;
- select DATE_FORMAT(date,‘%Y%m%d‘) days,count(id) count from table group by days;
- select DATE_FORMAT(date,‘%Y%m‘) months,count(id) count from table group by months;
时间: 2024-09-27 19:40:33