Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0d90db3

Browse files
committed
solve problem Department Highest Salary
1 parent 2058084 commit 0d90db3

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,4 +335,5 @@ All solutions will be accepted!
335335
|626|[Exchange Seats](https://leetcode-cn.com/problems/exchange-seats/description/)|[mysql](./database/ExchangeSeats)|Medium|
336336
|178|[Rank Scores](https://leetcode-cn.com/problems/rank-scores/description/)|[mysql](./database/RankScore)|Medium|
337337
|180|[Consecutive Numbers](https://leetcode-cn.com/problems/consecutive-numbers/description/)|[mysql](./database/ConsecutiveNumbers)|Medium|
338-
|177|[Nth Highest Salary](https://leetcode-cn.com/problems/nth-highest-salary/description/)|[mysql](./database/NthHighestSalary)|Medium|
338+
|177|[Nth Highest Salary](https://leetcode-cn.com/problems/nth-highest-salary/description/)|[mysql](./database/NthHighestSalary)|Medium|
339+
|184|[Department Highest Salary](https://leetcode-cn.com/problems/department-highest-salary/description/)|[mysql](./database/DepartmentHighestSalary)|Medium|
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Department Highest Salary
2+
We can solve this problem by MAX FUNCTION and sub-query
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Write your MySQL query statement below
2+
select d.Name as Department, e.Name as Employee, Salary
3+
from Employee as e, Department as d
4+
where e.DepartmentId = d.Id and Salary = (select max(Salary) from Employee where DepartmentId = d.Id)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /