[MySQL][LeetCode][Easy] 176. Second Highest Salary

心得:

找出該資料表內第二高薪水的筆數,若無則回傳null。

問題:

Write a SQL query to get the second highest salary from the Employee table.

For example, given the above Employee table, the second highest salary is 200. If there is no second highest salary, then the query should return null.

答案:

  1. Sub Query
  2. DISTINCT > 不重複
  3. GROUP BY > 不重複

     


這裡的資訊對您有用嗎?請我飲一杯咖啡?