Lateral
Lateral
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Lateral的博客
全部文章
(共115篇)
题解 | 查找所有员工的last_name和first_name以及对应的dept_name
select e.last_name, e.first_name, p.dept_name from employees e left join dept_emp d on e.emp_no=d.emp_no left join departments p on d.dept_no=p.dept_n...
2025-04-03
0
46
题解 | 获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
with tb as(select e.emp_no, s.salary, e.last_name, e.first_name from employees e left join salaries s on e.emp_no=s.emp_no) select emp_no, salary, ...
2025-04-03
0
33
题解 | 获取每个部门中薪水最高的员工相关信息
select t.dept_no, t.emp_no, t.salary from (select e.emp_no, e.dept_no, s.salary, row_number() over(partition by e.dept_no order by s.salary desc) as...
2025-04-02
0
47
题解 | 查找当前薪水详情以及部门编号dept_no
select s.*, m.dept_no from dept_manager m left join salaries s on m.emp_no=s.emp_no order by s.emp_no asc
2025-04-02
0
56
题解 | 查找入职员工时间升序排名的情况下的倒数第三的员工所有信息
select a.emp_no, a.birth_date, a.first_name, a.last_name, a.gender, a.hire_date from ( select *, ...
2025-04-02
0
34
题解 | 更新员工信息表
select e.EMPLOYEE_ID, if(e.LAST_UPDATE_DT<=t1.LAST_UPDATE_DT,t1.POSITION,e.POSITION) as POSITION, if(e.LAST_UPDATE_DT<=t1.LAST_UPDATE_DT,t1.LAST...
2025-04-01
0
43
题解 | 未下单用户登陆渠道统计
select u.channel, count(*) as cnt from user_info u left join order_log o on u.uid=o.uid where o.order_id is null group by u.channel order by cnt desc,...
2025-04-01
0
52
题解 | 用户订单信息查询
select c.city, sum(o.total_amount) as total_order_amount from orders o left join customers c on o.customer_id=c.customer_id group by c.city order by t...
2025-04-01
0
51
题解 | 播放量峰值top3高的视频
select t.cid, max(t.cnt) as max_peak_uv from (select a.cid, sum(if(a.start_time between b.start_time and b.end_time,1,0)) ...
2025-04-01
0
41
题解 | 未下单用户统计
select count(distinct u.uid) as cnt from user_info u left join order_log o on u.uid=o.uid where o.order_id is null
2025-04-01
0
38
首页
上一页
2
3
4
5
6
7
8
9
10
11
下一页
末页