Lateral
Lateral
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Lateral的博客
全部文章
(共115篇)
题解 | 支付间隔平均值
select cast(cast(avg(abs(timestampdiff(second,s.logtime,o.logtime)))as decimal(5,0))as unsigned) as gap from order_log o left join select_log s o...
2025-03-07
0
44
题解 | 每天登陆最早的用户的内容喜好
select t.log_day, t.user_id, t.hobby from (select date(l.log_time) as log_day, l.user_id, u.hobby, rank() over(partition by date(l.log_time) order by ...
2025-03-07
0
60
题解 | 统计加班员工占比
select t.department, concat(cast(sum(t.ifoverwork)*100/count(t.department) as decimal(5,1)),'%') as ratio from (select s.department, case when tim...
2025-03-07
0
40
题解 | 统计各个部门平均薪资
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
49
题解 | 查询单日多次下订单的用户信息?
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
60
题解 | 更新用户积分信息?
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
40
题解 | 统计用户获得积分
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
62
题解 | 统计员工薪资扣除比例
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
48
题解 | 统计用户从访问到下单的转化率
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
53
题解 | 查询下订单用户访问次数?
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
39
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页