路静
路静
全部文章
分类
归档
标签
去牛客网
登录
/
注册
路静的博客
全部文章
(共49篇)
题解 | 查询下订单用户访问次数?
select user_id, count(user_id) visit_nums from visit_tb where user_id in (select distinct user_id from order_tb where date(visit_time)='2022-09-02' an...
2025-07-09
0
47
题解 | 统计各等级会员用户下订单总额
select vip, sum(if(order_price is not null,order_price,0)) order_total from order_tb right join uservip_tb using(user_id) group by vip order by order_...
2025-07-09
0
68
题解 | 统计商家不同会员每日访问人次及访问人数
select vip, count(visit_time) visit_nums, count(distinct user_id) visit_users from visit_tb join uservip_tb using(user_id) group by vip order by visit...
2025-07-09
0
49
题解 | 查询连续登陆的用户
select user_id from ( select user_id, count(first_time) con_day, reg_port from( select user_id, reg_port, date...
2025-07-09
0
66
题解 | 统计各岗位员工平均工作时长
select post, round(avg(timestampdiff(second,first_clockin,last_clockin))/3600,3) work_hours from staff_tb join attendent_tb using(staff_id) where firs...
2025-07-09
0
58
题解 | 每个商品的销售总额
select name product_name, sum(quantity) total_sales, row_number() over (partition by category order by sum(quantity) desc,product_id) category_rank fr...
2025-07-09
0
36
题解 | 统计所有课程参加培训人次
SELECT c1_cnt+c2_cnt+c3_cnt AS staff_nums FROM (SELECT SUM(IF(course LIKE('%1%'),1,0)) c1_cnt, SUM(IF(course LIKE('%2%'),1,0)) c2_cnt, SUM(IF(course L...
2025-07-08
0
59
题解 | 查询连续入住多晚的客户信息?
SELECT user_id, room_id, room_type, DATEDIFF(checkout_time,checkin_time) AS days FROM guestroom_tb JOIN checkin_tb USING(room_id) WHERE checkin_time&g...
2025-07-08
0
61
题解 | 分析客户逾期情况
SELECT pay_ability, CONCAT(ROUND(SUM(IF(overdue_days IS NOT NULL,1,0))*100/COUNT(pay_ability),1),'%') AS overdue_ratio FROM loan_tb JOIN customer_tb U...
2025-07-08
0
57
题解 | 最长连续登录天数
SELECT user_id,max(consec_days) AS max_consec_days FROM ( SELECT b.user_id, b.first_date, COUNT(b.first_date) AS consec_days FROM ( ...
2025-07-08
0
72
首页
上一页
1
2
3
4
5
下一页
末页