solution.md 791 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
# 第N高的薪水

<p>编写一个 SQL 查询,获取 <code>Employee</code> 表中第&nbsp;<em>n&nbsp;</em>高的薪水(Salary)。</p>

<pre>+----+--------+
| Id | Salary |
+----+--------+
| 1  | 100    |
| 2  | 200    |
| 3  | 300    |
+----+--------+
</pre>

<p>例如上述&nbsp;<code>Employee</code>&nbsp;表,<em>n = 2&nbsp;</em>时,应返回第二高的薪水&nbsp;<code>200</code>。如果不存在第&nbsp;<em>n&nbsp;</em>高的薪水,那么查询应返回&nbsp;<code>null</code></p>

<pre>+------------------------+
| getNthHighestSalary(2) |
+------------------------+
| 200                    |
+------------------------+
</pre>


## template

```python


```

## 答案

```python

```

## 选项

### A

```python

```

### B

```python

```

### C

```python

```