题目:
代码:
SELECT d.Name as 'Department', e1.Name as 'Employee', e1.Salary
FROM Employee e1 INNER JOIN Department d
ON e1.DepartmentId = d.Id
WHERE 3 >= (
SELECT COUNT(DISTINCT e2.Salary)
FROM Employee e2
WHERE e2.Salary >= e1.Salary AND e2.DepartmentId = d.Id
)
ORDER By d.Name, e1.Salary DESC
结果如下:
如果有其他办法,请留言告诉我把~
觉得不错,就点赞或者关注~ ~
谢谢~