牛客987852806号
牛客987852806号
全部文章
分类
题解(45)
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
(共175篇)
题解 | 更新员工信息表
--先求更新表的每位employee_id的最后一次更新数据 with tiaojian as ( select EMPLOYEE_ID, UPDATE_DT, NEW_POSITION from( select EMPLOYEE_ID, UPDATE_DT, NEW_POSITION, den...
2025-10-10
0
31
题解 | 未下单用户统计
--另一个思路 select count(distinct case when order_id is null then uf.uid end) as cnt from order_log lg right join user_info uf on lg.uid=uf.uid
2025-10-10
0
24
题解 | 各个视频的平均完播率
select tg.video_id, round( avg(case when timestampdiff(second,start_time,end_time)>=duration then 1 else 0 end),3) as avg_comp_play_rate from tb_u...
2025-03-21
0
91
题解 | 试卷发布当天作答人数和平均分
with tiaojian as ( select uid from user_info where level>5 ),tiaojian1 as ( select exam_id, release_time from examination_info where tag="SQ...
2025-03-18
0
89
题解 | 月均完成试卷数不小于3的用户爱作答的类别
with tiaojian as ( select uid from exam_record group by uid having count(submit_time)/count(distinct month(submit_time))>=3 ) select tag, count(...
2025-03-18
0
102
题解 | 查询连续登陆的用户
with tiaojian as ( select user_id, date(log_time) as pday, row_number()over(partition by user_id order by date(log_time) ) as py from login_tb ),tiao...
2025-03-10
0
77
题解 | 商品销售总额分布
select case when pay_method="" then "error" else pay_method end as py, count(pay_method) as cnt from user_client_log lg left join ...
2025-02-21
0
77
题解 | 商品销售排名
with tiaojian as ( select lg.product_id, type, product_name, sum(price) as py, dense_rank()over(order by sum(price) desc,product_name asc) as pdiff f...
2025-02-21
1
81
题解 | 商品价格排名
#1.先求出每个商品类型的价格的前2名的商品。 #2.在将上述的商品在进行个排序,取前三。 with tiaojian as ( select product_id, product_name, type, price, dense_rank()over(partition by type orde...
2025-02-21
0
120
题解 | 用户购买次数前三
select uid, cnt from( select uid, count(distinct trace_id) as cnt, row_number()over(order by count(distinct trace_id) desc,uid) as pdiff from user_cl...
2025-02-21
1
87
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页