Lateral
Lateral
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Lateral的博客
全部文章
(共115篇)
题解 | 返回顾客名称和相关订单号以及每个订单的总价
select c.cust_name, o.order_num, sum(i.quantity*i.item_price) as OrderTotal from OrderItems i left join Orders o on i.order...
2025-04-01
0
47
题解 | 每个顾客购买的最新产品名称
select t.customer_id, t.customer_name, t.product_name as latest_order from (select o.customer_id, c.customer_name, p.product_name, row_number() over(p...
2025-03-31
0
28
题解 | 各个部门实际平均薪资和男女员工实际平均薪资
with t as( select t2.department, t2.staff_gender, t1.normal_salary-t1.dock_salary as actual_salary from salary_tb t1 left join staff_tb t2 on t1.staff...
2025-03-25
0
48
题解 | 统计每个产品的销售情况
with t2 as( select o.*, c.customer_age, month(o.order_date) as order_month from orders o left join customers c on ...
2025-03-25
0
45
题解 | 每个顾客最近一次下单的订单信息
select t.order_id, t.customer_name, t.order_date from (select o.order_id, c.customer_name, o.order_date, ...
2025-03-25
0
36
题解 | 商品id数据清洗统计
select substr(order_id,instr(order_id,'_')+1,4) as product_id, count(*) as cnt from order_log group by substr(order_id,instr(order_id,'_')+1,4) ...
2025-03-25
0
40
题解 | 查询订单
with newest_order as (select c.customer_name, o.order_id, o.order_date, row_number() over(partition by o.customer_id order by o.order_date de...
2025-03-25
0
37
题解 | top2的薪水排名
with ranking as( select department, employee_name, salary, rank() over(partition by department order by salary d...
2025-03-25
0
48
题解 | 每个部门薪资排名前两名员工
with ranking as(select *, rank() over(partition by department order by salary desc) as rank_number from employees) select department, ...
2025-03-25
0
45
题解 | 每个客户的账户总金额
select customer_id, sum(balance) as sum_balance from account group by customer_id order by sum_balance desc,customer_id asc
2025-03-25
0
44
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页