1 SQL31
select
day(date) as day,
count(question_id) as question_cnt
from
question_practice_detail
where
year(date) = 2021
and month(date) = 8
group by
date2 SQL32
select
round(count(q2.date)/count(q1.date), 4) as avg_ret
from
(select distinct device_id, date from question_practice_detail) q1
left join
(select distinct device_id, date from question_practice_detail) q2
on
q1.device_id = q2.device_id
and q2.date = date_add(q1.date, interval 1 day)3 SQL33
select
substring_index(profile, ",", -1) as gender,
count(device_id) as number
from
user_submit
group by
gender4 输入法测试
从前