当前位置:网站首页>【无标题】
【无标题】
2022-07-26 08:53:00 【小唐学姐】
SQL架构
Employee 表:
+-------------+------+ | Column Name | Type | +-------------+------+ | id | int | | salary | int | +-------------+------+ id 是这个表的主键。 表的每一行包含员工的工资信息。
编写一个 SQL 查询,获取并返回 Employee 表中第二高的薪水 。如果不存在第二高的薪水,查询应该返回 null 。
查询结果如下例所示。
示例 1:
输入: Employee 表: +----+--------+ | id | salary | +----+--------+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +----+--------+ 输出: +---------------------+ | SecondHighestSalary | +---------------------+ | 200 | +---------------------+
示例 2:
输入: Employee 表: +----+--------+ | id | salary | +----+--------+ | 1 | 100 | +----+--------+ 输出: +---------------------+ | SecondHighestSalary | +---------------------+ | null | +---------------------+
SELECT
IFNULL(
(SELECT DISTINCT Salary
FROM Employee
ORDER BY Salary DESC
LIMIT 1 OFFSET 1),
NULL) AS SecondHighestSalary边栏推荐
- NPM add source and switch source
- Web3 Games: current situation and future
- 2000年的教训。web3是否=第三次工业革命?
- My meeting of OA project (meeting seating & submission for approval)
- Self review ideas of probability theory
- Pytoch realizes logistic regression
- 深度学习常用激活函数总结
- Review notes of Microcomputer Principles -- zoufengxing
- Implementation of Prometheus web authentication and alarm
- In the first year of L2, the upgrade of arbitrum nitro brought a more compatible and efficient development experience
猜你喜欢

合工大苍穹战队视觉组培训Day5——机器学习,图像识别项目

Database operation skills 7

In the first year of L2, the upgrade of arbitrum nitro brought a more compatible and efficient development experience

(1) CTS tradefed test framework environment construction

Deploy prometheus+grafana monitoring platform
![[encryption weekly] has the encryption market recovered? The cold winter still hasn't thawed out. Take stock of the major events that occurred in the encryption market last week](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[encryption weekly] has the encryption market recovered? The cold winter still hasn't thawed out. Take stock of the major events that occurred in the encryption market last week

Registration of finite element learning knowledge points

node-v下载与应用、ES6模块导入与导出

Study notes of automatic control principle -- dynamic model of feedback control system
![[leetcode database 1050] actors and directors who have cooperated at least three times (simple question)](/img/ab/bad6b86039384af7b829bef5316923.png)
[leetcode database 1050] actors and directors who have cooperated at least three times (simple question)
随机推荐
Espressif plays with the compilation environment
Vision Group Training Day5 - machine learning, image recognition project
unity简易消息机制
PAT 甲级 A1013 Battle Over Cities
In the first year of L2, the upgrade of arbitrum nitro brought a more compatible and efficient development experience
Media at home and abroad publicize that we should strictly grasp the content
My meeting of OA project (query)
【数据库 】GBase 8a MPP Cluster V95 安装和卸载
The effective condition of MySQL joint index and the invalid condition of index
Huffman transformation software based on C language
Arbitrum launched the anytrust chain to meet the diverse needs of ecological projects
Cve-2021-21975 VMware SSRF vulnerability recurrence
Transfer guide printing system based on C language design
Day06 homework - skill question 6
Super potential public chain dfinity -- the best time for DFI developers to enter
Study notes of automatic control principle -- dynamic model of feedback control system
第6天总结&数据库作业
Poor English, Oracle OCP or MySQL OCP exam can also get a high score of 80 points
Datawhale panda book has been published!
Database operation skills 6