三个where条件都可以满足题目要求
select count(distinct device_id)did_cnt, count(question_id)question_cnt from question_practice_detail where year(date) = 2021 and month(date) = 8 # where date like '2021-08%' # where date between '2021-08-01' and '2021-08-31'
select count(distinct device_id)did_cnt, count(question_id)question_cnt from question_practice_detail where year(date) = 2021 and month(date) = 8 # where date like '2021-08%' # where date between '2021-08-01' and '2021-08-31'