在走神的马来熊
在走神的马来熊
全部文章
分类
归档
标签
去牛客网
登录
/
注册
在走神的马来熊的博客
全部文章
(共37篇)
题解 | #考试分数(五)#
with r1 as (select id,job,score,row_number()over(partition by job order by score desc) t_rank from grade ),r2 as ( select job,if(mod(count(id),2)...
2024-05-24
1
136
题解 | #考试分数(四)#
select job,if(mod(count(id),2)=0,count(id) div 2,(count(id) div 2)+1) start,if(mod(count(id),2)=0,(count(id) div 2)+1,(count(id) div 2)+1) end from gr...
2024-05-21
0
179
题解 | #牛客每个人最近的登录日期(六)#
select u.name,p.date,sum(p.number)over(partition by p.user_id order by date) from passing_number p join user u on p.user_id=u.id order by p.date,u.nam...
2024-05-21
1
138
题解 | #异常的邮件概率#
select date,round(count(if(type='no_completed',1,null))/count(type),3) from email where send_id in(select id from user where is_blacklist=0) and recei...
2024-05-11
0
128
题解 | #牛客每个人最近的登录日期(五)#
with new as ( select user_id,min(date) nu from login group by user_id--找出新用户 ), jg as ( select new.nu,lo.user_id,lo.client_id,lo.date da,d...
2024-05-10
0
145
题解 | #浙大不同难度题目的正确率#
select qde.difficult_level,count(if(qp.result='right',1,null))/count(qp.question_id) correct_rate from (select device_id from user_profile where unive...
2024-05-09
0
142
题解 | #统计复旦用户8月练题情况#
select user.device_id,university,count(id) question_cnt,count(if(result='right',1,null)) right_question_cnt from (select device_id,university from use...
2024-05-09
0
131
题解 | #牛客每个人最近的登录日期(四)#
比较简洁的写法 select date,sum(ne) new from (select *,if(first_value(date)over(partition by user_id order by date)=date,1,0) ne from login) l1 group by ...
2024-04-24
0
140
题解 | #牛客每个人最近的登录日期(三)#
个人感觉十分的简洁 select round(sum(p1)/count(distinct user_id),3) p from ( select *,if(date=date_add(d1,interval 1 day),1,0) p1 from (select *,first_value(dat...
2024-04-24
0
124
题解 | #异常的邮件概率#
select e.date,round(if(c2 is null,0,c2)/c1,3) p from (select date,count(type) c1 from email where send_id in(select id from user where is_blacklist=0)...
2024-04-23
0
159
首页
上一页
1
2
3
4
下一页
末页