题解 | #计算用户8月每天的练题数量#

计算用户8月每天的练题数量

https://www.nowcoder.com/practice/847373e2fe8d47b4a2c294bdb5bda8b6

select
day(date) as day,
count(question_id) as question_cnt
from question_practice_detail
where date like ('2021-08%')
#重点是where句,他有三种改法
#1.like写法:where date like ('2021-08%)
#2.正则表达式写法:where date regexp '2021-08'
#3.substring写法:where substring(date,1,7) = '2021-08' 即date字符串第一个到第七个截取的子串为‘2021-08’
group by date;

全部评论

相关推荐

认真搞学习:这个真喷不了,你是我见过最美的牛客女孩
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务