select count(m1.device_id) / (select count(m.date) from (select distinct y.date,y.device_id,y.question_id,y.result from question_practice_detail y) m) from (select distinct a.device_id, a.date, c.date as 'cdate' from question_practice_detail a left join (select b.device_id, b.date #date_sub(b.date,...