牛客963740689号
牛客963740689号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客963740689号的博客
全部文章
(共4篇)
题解 | 输出播放量最高的视频
WITH time_point_play_count AS ( -- 生成所有可能的时间点,这里通过对start_time和end_time去重后合并得到 SELECT DISTINCT time_point FROM ( SELECT start_time ...
2025-03-19
0
88
题解 | 每个顾客购买的最新产品名称
with t as( SELECT o.customer_id,customer_name,product_name as latest_order,rank() OVER(PARTITION BY customer_id ORDER BY order_date DESC) as num F...
2025-03-19
0
63
题解 | 各个部门实际平均薪资和男女员工实际平均薪资
with t as( SELECT staff_gender,department,normal_salary-dock_salary as salary FROM staff_tb as st INNER JOIN salary_tb as sa ON st.staff_id=sa.staff_...
2025-03-19
13
72
题解 | 统计每个产品的销售情况
/* --t1筛选出前5列,t2先按product_id,month(order_date)统计出各商品的最大月销售量 --t3使用窗口函数ROW_NUMBER按最大月销量进行DESC排序,便于最后挑选出最大月销量 --t4先按product_id,customer_id统计出各商品的每个客户的年购...
2025-03-19
7
62