select count(distinct device_id),count(question_id)
from question_practice_detail
where substring_index(date,'_',2)='2021-08'
提取八月的用户,用substring_index就跑不出来,为啥呀
你看看substring_index这个函数用对了没有。你可以先查询看看。用 select substring_index(date,'_',2) from question_practice_detail这个sql语句,运行一下,看有什么结果。每一个数据库,有些语句稍微有些差别的。不知道你用的什么数据库。