leetcode 176. Second Highest Salary
来源:互联网 发布:电子挂历制作软件 编辑:程序博客网 时间:2024/06/05 15:05
176. Second Highest Salary
1. 建表
create table if not exists Employee ( Id int(10) not null auto_increment, Salary int(20) default null, primary key(Id))ENGINE=InnoDB DEFAULT CHARSET=utf8;insert into Employee(Salary) values(100);insert into Employee(Salary) values(200);insert into Employee(Salary) values(300);select * from Employee;
2.答案
select ( select distinct Salary from Employee order by Salary Desc limit 1 offset 1)as SecondHighestSalaryselect max(Salary) as SecondHighestSalary from Employee where Salary <> (select max(Salary) from Employee);select max(Salary) as SecondHighestSalary from Employee where Salary !=(select max(Salary) from Employee)SELECT max(Salary) as SecondHighestSalary FROM EmployeeWHERE Salary < (SELECT max(Salary) FROM Employee);SELECT max(Salary) as SecondHighestSalaryFrom EmployeeWHERE Salary not in (SELECT max(Salary) FROM Employee )
阅读全文
1 0
- leetcode 176. Second Highest Salary
- leetcode 176. Second Highest Salary
- leetcode.176. Second Highest Salary
- leetcode 176. Second Highest Salary
- Leetcode 176. Second Highest Salary
- leetcode 176. Second Highest Salary
- leetcode 176. Second Highest Salary
- 176. Second Highest Salary(Leetcode)
- LeetCode:Second Highest Salary
- Leetcode: Second Highest Salary
- LeetCode Second Highest Salary
- Second Highest Salary Leetcode
- Leetcode: Second Highest Salary
- LeetCode Second Highest Salary
- 【Leetcode】 Second Highest Salary
- leetcode-Second Highest Salary
- 【LeetCode】Second Highest Salary && Nth Highest Salary
- LeetCode | Second Highest Salary & Nth highest salary
- python中函数的使用
- Anaconda装OpenCV3
- 以太坊(1)--在CentOS 6.5上搭建以太坊私有链的步骤(图文详细)
- JDK7安装和配置 JAVA JDK7安装配置教程
- java类的初始化顺序
- leetcode 176. Second Highest Salary
- 002--swift初体验
- Tensorflow四种交叉熵函数计算公式:tf.nn.cross_entropy
- LVM磁盘管理
- 如何实现iOS热更新
- Jsp动态网页开发
- 企业网站上演“变形计” 中企动力剑指“商业入口”
- wamp2.5配置域名
- 对ES6中let与const命令初步了解