select
    count(DISTINCT device_id),
    count(question_id)
from
    question_practice_detail
where
    date LIKE '2021-08%'

DISTINCT是可以放在count()里面使用的,作用是去重!