牛客447848010号
牛客447848010号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客447848010号的博客
全部文章
(共7篇)
题解 | 短视频直播间晚上11-12点之间各直播间的在线人数
with a as( select room_id,user_id,date_format(in_time,'%H') as intime,date_format(out_time,'%H') as outtime from user_view_tb having intime in (23,24...
2025-06-19
0
9
题解 | 查询下订单用户访问次数?
select user_id,count(distinct visit_time) as visit_nums #因为ID12的用户在20220902下了两次单,但浏览记录只有一条(或者n条),这种情况下,在把表左链接起来的时候,会出现重复两行(或者2n行)相同的ID,visit_time,leav...
2025-06-18
0
10
题解 | 统计各岗位员工平均工作时长
select post,round(avg(a.hours),3) as work_hours from( select staff_tb.staff_id,post,round(timestampdiff(second,first_clockin,last_clockin)/3600,3) as ...
2025-06-18
0
10
题解 | 每个商品的销售总额
select c.product_name,total_sales,category_rank from( select b.product_name as 'product_name',total_sales,category_row,row_number() over(partition by ...
2025-06-18
0
10
题解 | 分析客户逾期情况
select pay_ability,concat(round(sum(if(b.overdue=0,0,1))*100/count(*),1),'%') as overdue_ratio #用字段concat函数进行字段连接,把%加上去 from( select a.customer_id,pa...
2025-06-16
0
12
题解 | 最长连续登录天数
select user_id,max(consec_days) as max_consec_days from( select user_id, new_date,count(1) as consec_days from( select user_id,date_sub(fdate,interval...
2025-06-16
0
9
题解 | 每个月Top3的周杰伦歌曲
select * from( select month,row_number() over(partition by a.month order by a.play_pv desc) as ranking,song_name,play_pv from( select month,t.song_nam...
2025-06-16
0
12