题解 | #浙江大学用户题目回答情况#
计算用户8月每天的练题数量
http://www.nowcoder.com/practice/847373e2fe8d47b4a2c294bdb5bda8b6
select
substr(date, 9, 2) as day, count(*) as question_cnt
from question_practice_detail
where date like '2021-08-%'
group by date
-- substr('string', beginPosition, size ) :字符串,开始位置(从1开始), 取几个
本题大致思路都差不多,主要是DAY函数效率较低,可以使用SUBSTR函数代替。