牛客85328445号
牛客85328445号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客85328445号的博客
全部文章
/ 题解
(共3篇)
题解 | #统计各个部门的工资记录数#
把三个先用inner join 全部联结起来,用with clause把联结起来的表暂时取名t1。然后就 group by + count,最后根据 dept_no order一下答案就出来了。推荐使用with clause,搞一些subtable 简洁高效,增加代码可读性。 with t1 as ...
Mysql
2022-01-03
0
266
题解 | #获取当前薪水第二多的员工的emp_no以及其对应的薪水salary#
select emp_no, salary, last_name, first_name from employees join salaries using (emp_no) where salary = (select max(salary) from employees inner joi...
Mysql
2021-09-21
0
398
题解 | #获取每个部门中当前员工薪水最高的相关信息#
select t2.dept_no, max(emp_no), t2.maxSalaries from (select t1.dept_no, salaries.emp_no, t1.maxSalaries from salaries join (select dept_no, emp_no, ma...
Mysql
2021-09-18
1
281