sql 185.部门前三名薪水.sql

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 185.部门前三名薪水.sql相关的知识,希望对你有一定的参考价值。

# Write your MySQL query statement below

SELECT D.Name AS Department, A.Name AS Employee, A.Salary AS Salary
FROM Department AS D, Employee AS A
WHERE (SELECT COUNT(DISTINCT(B.Salary)) AS RANK
FROM Employee AS B
WHERE B.Salary >= A.Salary and A.DepartmentId = B.DepartmentId) <= 3 AND A.DepartmentId = D.Id
ORDER BY A.DepartmentId, A.Salary DESC;

以上是关于sql 185.部门前三名薪水.sql的主要内容,如果未能解决你的问题,请参考以下文章

sql 185.部门前三名薪水.sql

sql 185.部门前三名薪水.sql

sql 185.部门前三名薪水.sql

sql 185.部门前三名薪水.sql

sql语句实例练习

sql 184.部门最高薪水(第1名).sql