L重启中
L重启中
全部文章
分类
归档
标签
去牛客网
登录
/
注册
L重启中的博客
全部文章
(共51篇)
题解 | 统计所有课程参加培训人次
select sum(if(course like '%course1%',1,0))+sum(if(course like '%course2%',1,0))+sum(if(course like '%course3%',1,0)) staff_nums from cultivate_tb
2026-03-16
0
14
题解 | 查询连续入住多晚的客户信息?
select t1.user_id user_id ,t1.room_id room_id ,t2.room_type room_type ,datediff(t1.checkout_time,t1.checkin_time) days from checkin_tb t1 join gue...
2026-03-16
0
15
题解 | 获取指定客户每月的消费额
select left(t_time,7) time ,sum(t_amount) total from trade where left(t_time,4) = '2023' and t_cus = (select c_id from customer where c_name = 'Tom'...
2026-03-16
0
16
题解 | 用户订单信息查询
select t1.city city ,sum(t2.total_amount) total_order_amount from customers t1 join orders t2 on t1.customer_id = t2.customer_id group by 1 order by 2...
2026-03-15
0
17
题解 | 未下单用户统计
select count(uid) cnt from user_info where uid not in ( select distinct uid from order_log )
2026-03-15
0
16
题解 | 返回顾客名称和相关订单号以及每个订单的总价
select t1.cust_name cust_name ,t2.order_num order_num ,t3.quantity * t3.item_price OrderTotal from Customers t1 join Orders t2 on t1.cust_id = t2.cu...
2026-03-15
0
17
题解 | 返回顾客名称和相关订单号以及每个订单的总价
select t1.cust_name cust_name ,t2.order_num order_num ,t3.quantity * t3.item_price OrderTotal from Customers t1 join Orders t2 on t1.cust_id = t2.cu...
2026-03-15
0
16
题解 | 商品id数据清洗统计
with a as ( select substring_index(order_id,'_',-1) product_id ,count(*) cnt from order_log group by 1 ) select product_id ,cnt from a where ...
2026-03-15
0
11
题解 | 查询订单
select t1.order_id ,t2.customer_name customer_name ,t1.order_date order_date from ( select order_id ,customer_id ,order_date ,rank()over(parti...
2026-03-15
0
15
题解 | 每个客户的账户总金额
select customer_id ,sum(balance) sum_balance from account group by 1 order by 2 desc,1
2026-03-15
0
10
首页
上一页
1
2
3
4
5
6
下一页
末页