lizhenzhen
lizhenzhen
全部文章
分类
归档
标签
去牛客网
登录
/
注册
lizhenzhen的博客
全部文章
(共65篇)
题解 | 更新员工信息表
with emp1 as (select * from EMPLOYEE_INFO union all select EMPLOYEE_ID, NEW_POSITION as POSITION,UPDATE_DT as LAST_UPDATE_DT from EMPLOYEE_UPDATE), em...
2025-12-05
1
20
题解 | 未下单用户登陆渠道统计
select channel, count(distinct uid) as cnt from user_info u where uid not in(select uid from order_log) group by channel order by cnt desc,c...
2025-12-05
1
18
题解 | 用户订单信息查询
select city, sum(total_amount) as total_order_amount from orders join customers using(customer_id) group by city order by total_order_amount...
2025-12-05
1
23
题解 | 未下单用户统计
select count(distinct uid) from (select u.uid from order_log o right join user_info u on o.uid=u.uid where order_id is ...
2025-12-05
1
22
题解 | 返回顾客名称和相关订单号以及每个订单的总价
select cust_name, o1.order_num as order_num, sum(quantity*item_price) as OrderTotal from OrderItems o1 join Orders o2 on o1.order_num=o2....
2025-12-05
1
23
题解 | 输出播放量最高的视频
-- 观看表自连接,求出同时在线的人数 with t as (select a.id,a.cid, sum(if(a.start_time between b.start_time and b.end_time,1,0)) as cnt from play_record_tb a ...
2025-12-05
1
15
题解 | 每个顾客购买的最新产品名称
select customer_id, customer_name, product_name as latest_order from (select customer_id,customer_name,product_name, ...
2025-12-05
1
27
题解 | 各个部门实际平均薪资和男女员工实际平均薪资
with t1 as-- 求出 部门-性别 下的实发工资 (select staff_gender, normal_salary-dock_salary as actual_salary, department from staff_tb st j...
2025-12-05
1
24
题解 | 统计每个产品的销售情况
-- step1取出现有的数据 with t1 as (select p.product_id,-- 产品ID round(sum(unit_price*quantity),2) as total_sales,-- 总销售额 unit_price,-- 单价 roun...
2025-12-05
1
18
题解 | 每个顾客最近一次下单的订单信息
select order_id, customer_name, order_date from (select *, row_number() over(partition by customer_id order by order_date desc) as...
2025-12-04
1
21
首页
上一页
1
2
3
4
5
6
7
下一页
末页