牛客987852806号
牛客987852806号
全部文章
分类
题解(45)
归档
标签
去牛客网
登录
/
注册
牛客987852806号的博客
全部文章
(共166篇)
题解 | 最受欢迎的top3课程
--简单写法,group by 加上datediff select tb.cid, count(pb.id) as pv, sum(timestampdiff(minute,start_time,end_time)) as time_len from play_record_tb pb inner...
2025-10-10
0
7
题解 | 更新员工信息表
--先求更新表的每位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
12
题解 | 未下单用户统计
--另一个思路 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
8
题解 | 各个视频的平均完播率
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
76
题解 | 试卷发布当天作答人数和平均分
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
81
题解 | 月均完成试卷数不小于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
87
题解 | 查询连续登陆的用户
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
60
题解 | 商品销售总额分布
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
68
题解 | 商品销售排名
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
74
题解 | 商品价格排名
#1.先求出每个商品类型的价格的前2名的商品。 #2.在将上述的商品在进行个排序,取前三。 with tiaojian as ( select product_id, product_name, type, price, dense_rank()over(partition by type orde...
2025-02-21
0
104
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页