高级资深攻城狮
高级资深攻城狮
全部文章
分类
题解(90)
归档
标签
去牛客网
登录
/
注册
高级资深攻城狮的博客
全部文章
(共16篇)
题解 | #对所有员工的薪水按照salary降序进行1-N的排名#
一开始写了两种解法,“解决方案一” 和 “解决方案二”,解决方案二解决不了问题,这两个解决方案的不同之处在于筛选条件where中的不同,“解决方案一”: where employees.emp_no not in(select emp_no from dept_manager)。“解决方案二”:(...
Sqlite
2021-09-23
0
275
题解 | #对所有员工的薪水按照salary降序进行1-N的排名#
select s1.emp_no, s1.salary, count(distinct s2.salary) as rankfrom salaries as s1, salaries as s2where s1.salary <= s2.salary and s1.to_date='9999-...
Sqlite
2021-09-23
0
209
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
select dept_emp.dept_no, dept_emp.emp_no, MAX(salaries.salary)from dept_emp,salarieswhere dept_emp.emp_no=salaries.emp_no group ...
Sqlite
2021-09-16
1
285
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
select dept_emp.emp_no,dept_manager.emp_no from dept_emp,dept_manager where (dept_emp.dept_no= dept_manager.dept_no) and dept_emp.emp_no not in (selec...
Sqlite
2021-09-16
1
191
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
SELECT emp_no,count(emp_no) as t FROM salaries GROUP by emp_no having t >15 先使用select查出领导的emp_no,再使用not in select出不在领导范围内的emp_no
Sqlite
2021-09-16
0
225
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
SELECT emp_no,count(emp_no) as t FROM salaries GROUP by emp_no having t >15 查询出现15次的员工,先按“emp_no”来分组,然后使用count函数来统计次数
Sqlite
2021-09-16
1
201
首页
上一页
1
2
下一页
末页