Chueagle
Chueagle
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Chueagle的博客
全部文章
(共22篇)
题解 | 统计各等级会员用户下订单总额
select u.vip,ifnull(sum(o.order_price),0) as order_total from order_tb o right join uservip_tb u on o.user_id=u.user_id group by u.vip order by sum(o...
2025-09-19
0
17
题解 | 统计商家不同会员每日访问人次及访问人数
select u.vip,count(v.visit_time ) as visit_nums,count(distinct v.user_id) as visit_users from visit_tb v join uservip_tb u on v.user_id=u.user_id grou...
2025-09-19
0
14
题解 | 查询连续登陆的用户
with log as ( select * ,date_format(log_time,'%Y-%m-%d') as dt,row_number()over(partition by user_id order by log_time) as rk from login_t...
2025-09-18
0
16
题解 | 统计各岗位员工平均工作时长
with at as ( select *,timestampdiff(second,first_clockin,last_clockin)/3600 as tmp from attendent_tb ) select s.post,round(avg(tmp),3) as work...
2025-09-18
0
18
题解 | 每个商品的销售总额
select p.name as product_name,a.t as total_sales,row_number()over(partition by p.category order by a.t desc) as category_rank from ( select product_id...
2025-09-17
0
13
题解 | 推荐内容准确的用户平均评分
select avg(score) from (select distinct score from recommend_tb join user_action_tb on recommend_tb.rec_user=user_action_tb.user_id where rec_info_l=h...
2025-09-17
0
20
题解 | 查询培训指定课程的员工信息
select a.staff_id,s.staff_name from (select *,right(course,7) as co from cultivate_tb) a left join staff_tb s on a.staff_id=s.staff_id where a.co='cou...
2025-09-17
0
17
题解 | 统计所有课程参加培训人次
select sum( case when course is null then 0 else (length(course)-length(replace(course,',','')))+1 end ) as staff_nums from cultivate...
2025-09-17
0
12
题解 | 查询连续入住多晚的客户信息?
with ch as ( select * from checkin_tb where date_format(checkin_time,'%Y-%m-%d')>='2022-06-12' ) select a.user_id,g.room_id,g.room_type...
2025-09-17
0
20
题解 | 获取指定客户每月的消费额
with cu as ( select * from trade where year(t_time)='2023' and t_type='1' ) select DATE_FORMAT(t_time, '%Y-%m') as time,sum(t_amount) a...
2025-09-17
0
32
首页
上一页
1
2
3
下一页
末页