Lateral
Lateral
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Lateral的博客
全部文章
(共102篇)
题解 | 统计各个部门平均薪资
select t1.department, cast(avg(t2.normal_salary-t2.dock_salary) as decimal(10,3)) as avg_salary from staff_tb t1 left join salary_tb...
2025-03-04
0
39
题解 | 查询单日多次下订单的用户信息?
select date(o.order_time) as order_date, o.user_id, count(distinct o.order_time) as order_nums, u.vip from order_tb o left join ...
2025-03-04
0
48
题解 | 更新用户积分信息?
select t.user_id, t.newpoint+t.point as point from (select o.user_id, sum(o.order_price) as newpoint, u.point from order_tb o left ...
2025-03-04
0
30
题解 | 统计用户获得积分
select t.user_id, cast(sum(t.point) as decimal(3,0)) as point from (select user_id, case-----准确理解“每满10分钟获得1积分”的含义 when timestampdiff(minu...
2025-03-04
0
46
题解 | 统计员工薪资扣除比例
select st.staff_id, st.staff_name, concat(cast((sl.dock_salary*100/sl.normal_salary) as decimal(5,1)),'%') as dock_ratio from staff_tb st left join sa...
2025-03-04
0
36
题解 | 统计用户从访问到下单的转化率
select t1.date, concat(cast((t1.order_nums*100/t2.visit_nums) as decimal(5,1)),'%') as cr from (select date(v.visit_time) as date, count(dist...
2025-03-04
0
46
题解 | 查询下订单用户访问次数?
select v.user_id, count(distinct v.visit_time) as visit_nums from visit_tb v left join order_tb o on o.user_id=v.user_id and o.order...
2025-03-04
0
34
题解 | 查询连续登陆的用户
select t.user_id as user_id from (select l.user_id, date(l.log_time) as log_day, row_number() over(partition by l.user_id order by date(l.log_time) de...
2025-03-04
0
38
题解 | 每个商品的销售总额
select t.product_name, t.total_sales, row_number() over(partition by t.category order by t.total_sales desc,t.product_id asc) as category_rank from (s...
2025-03-03
0
42
题解 | 推荐内容准确的用户平均评分
select sum(distinct u.score)/count(distinct u.score) as avg_score from recommend_tb r left join user_action_tb u on u.user_id=r.rec_user where r.rec...
2025-03-03
0
29
首页
上一页
2
3
4
5
6
7
8
9
10
11
下一页
末页