又菜又爱玩^
又菜又爱玩^
全部文章
分类
题解(25)
归档
标签
去牛客网
登录
/
注册
又菜又爱玩^的博客
全部文章
(共30篇)
题解 | #2021年11月每天新用户的次日留存率#
with tmp as ( select distinct t1.uid,date(in_time) login_date,date(out_time) as out_date,t2.min_date from tb_user_log t1 left join (select u...
2023-08-19
0
159
题解 | #计算用户的平均次日留存率#
select avg(if(datediff(date,lag_date)=1,1,0)) as avg_ret from ( select device_id,date,lag(date) over (partition by device_id order by date) lag_d...
2023-03-10
0
113
题解 | #月总刷题数和日均刷题数#
SELECT submit_month,montn_q_cnt,round(montn_q_cnt/days,3) FROM ( SELECT ifnull(submit_month,'2021汇总') AS submit_month, ...
2023-02-15
0
142
题解 | #平均活跃天数和月活人数#
SELECT date_format(submit_time,'%Y%m') month, round(count(DISTINCT concat(uid,date_format(submit_time,'%Y-%m-%d')))/count(DISTINCT uid),2) avg...
2023-02-15
0
115
题解 | #2021年11月每天新用户的次日留存率#
with a as ( select t3.uid,t3.first_date,t3.login_date,datediff(t3.login_date,t3.first_date) as remain_date from ( select distinct ...
2023-02-07
0
169
题解 | #每篇文章同一时刻最大在看人数#
select artical_id,max(cnt) as max_uv from ( select artical_id, sum(num) over (partition by artical_id order by dt,...
2023-02-06
0
161
题解 | #2021年11月每天的人均浏览文章时长#
SELECT date(in_time) dt, round(sum(time_to_sec(timediff(out_time,in_time)))/count(DISTINCT uid),1) AS avg_viiew_len_sec FROM tb_user_log WHERE substr(...
2023-02-06
0
108
题解 | #各个视频的平均完播率#
WITH t AS ( SELECT t1.video_id, ( unix_timestamp(end_time) - unix_timestamp(start_time) ) as diff_second, t2.duration FROM ...
2022-12-30
0
142
题解 | #今天的刷题量(一)#
-- 看着简简单单 但是我写的很复杂 WITH subnew AS ( SELECT submission.id,subject_id,create_time,name FROM submission LEFT JOIN subject s ON s...
Mysql
2022-03-08
0
312
题解 | #网易云音乐推荐(网易校招笔试真题)#
分解 分解 YYDS SELECT t1.music_name FROM ( WITH follow_new AS ( SELECT follower_id FROM follow WHERE user...
Mysql
2022-02-22
0
256
首页
上一页
1
2
3
下一页
末页