【Leetcode】 Second Highest Salary
題目:
Write a SQL query to get the second highest salary from the Employee table.
+—-+——–+
| Id | Salary |
+—-+——–+
| 1 | 100 |
| 2 | 200 |
| 3 | 300 |
+—-+——–+
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.
思路:
子查詢
演算法:
select max(salary) from Employee where salary<(select max(salary) from Employee)
相關推薦
【LeetCode】Second Highest Salary && Nth Highest Salary
Total Accepted: 1030 Total Submissions: 4309 My Submissions Question Solution Write a SQL query to get the second highest salary from th
【Leetcode】 Second Highest Salary
題目: Write a SQL query to get the second highest salary from the Employee table. +—-+——–+ | Id |
sql leetcode 176. Second Highest Salary
Write a SQL query to get the second highest salary from the Employeetable. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2
leetcode 2--Second Highest Salary
https://leetcode.com/problems/second-highest-salary/description/ Write a SQL query to get the second highest salary from the Employee table. +—
leetcode 176. Second Highest Salary
Write a SQL query to get the second highest salary from the Employee table. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 | 200
【Leetcode】176. Second Highest Salary (Easy)
1.題目Write a SQL query to get the second highest salary from the Employee table.+----+--------+ | Id | Salary | +----+--------+ | 1 | 100
【LeetCode】184. Department Highest Salary
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id. +----+----
LeetCode-第二高的薪水(second-highest-salary)
第二高的薪水 難度 簡單 更多LeetCode答案歡迎大家關注Github: https://github.com/lxyer/LeetCodeAnswer 編寫一個 SQL 查詢,獲取 Employee 表中第二高的薪水(Salary) 。 +----+---
LeetCode Second Highest Salary
Problem Write a SQL query to get the second highest salary from the Employee table. +----+--------+ | Id | Salary | +----
[LeetCode] Second Highest Salary 第二高薪水
Write a SQL query to get the second highest salary from the Employee table. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 | 2
176. Second Highest Salary(Leetcode)
文章出處:http://www.cnblogs.com/grandyang/p/5348961.html Write a SQL query to get the second highest salary from the Employee table. +----+
LeetCode-Algorithms #002 Add Two Numbers, Database #176 Second Highest Salary
LeetCode-Algorithms #002 Add Two Numbers 給定兩個非空的以連結串列結構表示的非負整數, 這個結構長這樣: 1 public class ListNode { 2 int val; 3 ListNode next; 4 ListNode(int
[理解leetcode解法]176. Second Highest Salary
176. Second Highest Salary #題目: Write a SQL query to get the second highest salary from theEmploy
【LeetCode】091. Decode Ways
rom size etc oss following nbsp pan ron ann 題目: A message containing letters from A-Z is being encoded to numbers using the following map
【LeetCode】040. Combination Sum II
log bsp for ont end ati 無法 clas class 題目: Given a collection of candidate numbers (C) and a target number (T), find all unique combinatio
【LeetCode】240. Search a 2D Matrix II
target ott arc rop win mat ive pty his 題目: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the
【LeetCode】215. Kth Largest Element in an Array
distinct class ted ++ bsp order algo max git 題目: Find the kth largest element in an unsorted array. Note that it is the kth largest eleme
【LeetCode】169. Majority Element
turn end and else pear ive element emp bsp 題目: Given an array of size n, find the majority element. The majority element is the element t
【LeetCode】064. Minimum Path Sum
ive rom right ott path sum 處理 tom ber its 題目: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom ri
【LeetCode】241. Different Ways to Add Parentheses
cto only leetcode save ++ ssi brush log ive 題目: Given a string of numbers and operators, return all possible results from computing all t