牛客574098914号
牛客574098914号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客574098914号的博客
全部文章
/ 题解
(共18篇)
题解 | #满足条件的用户的试卷完成数和题目练习数#
select a.uid, count(distinct case when year(b.submit_time) = '2021' then b.id else null end) as exam_cnt, count(distinct ca...
Mysql
2022-04-27
0
358
题解 | #2021年11月每天的人均浏览文章时长#
select date_format(in_time,'%Y-%m-%d') as dt, round(sum(timestampdiff(second, in_time, out_time)) / count(distinct uid), 1) as avg_viiew_len_sec fr...
Mysql
2022-04-26
1
344
题解 | #平均活跃天数和月活人数#
select author, date_format(start_time,'%Y-%m') month, round(sum(case when if_follow=1 then 1 when if_follow=2 then -1 else 0 end)...
Mysql
2022-04-25
0
278
题解 | #平均活跃天数和月活人数#
select date_format(submit_time, '%Y%m') as month, round( count(distinct uid, date_format(submit_time, '%Y%m%d')) / count(distinct uid), 2) as avg_ac...
Mysql
2022-04-19
0
327
题解 | #修改表#
alter table user_info add school varchar(15) after level; alter table user_info change job profession varchar(10); alter table user_info modify achiev...
Mysql
2022-04-18
0
219
题解 | #计算用户的平均次日留存率#
select count(distinct device_id) as did_cnt, count(question_id) as question_cnt from question_practice_detail where year(date)=2021 and month(date)...
Mysql
2022-04-06
0
228
题解 | #计算用户的平均次日留存率#
select qd.difficult_level as difficult_level, sum(case when qpd.result = "right" then 1 else 0 end)/ count(qpd.device_id) as correct_rate from us...
Mysql
2022-04-06
0
243
题解 | #计算男生人数以及平均GPA#
select count(gender) as male_num, round (avg(gpa), 1) as avg_gpa from user_profile where gender = "male" 注意缩进,count函数与括号之间不要留空格
Mysql
2022-04-05
0
185
首页
上一页
1
2
下一页
末页