赞
踩
year(date)=2021 and month(date)=8
,比如用date_format函数的date_format(date, "%Y-%m")="202108"
group by date
- select
- day(date) as day,
- count(question_id) as question_cnt
- from question_practice_detail
- where month(date)=8 and year(date)=2021
- group by date
1.然后可以用 substring(date,起点下标,截取个数)也可以获取 其中部分数据
2.然后匹配月份可以(比如想要八月份的内容的数据) :date like '2021-08%'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。