赞
踩
题目
编写一个 SQL 查询,获取Employee 表中第二高的薪水(Salary) 。
例如上述 Employee 表,SQL查询应该返回 200 作为第二高的薪水。如果不存在第二高的薪水,那么查询应返回 null。
结果如下:
考点:LIMIT/TOP/ROW_NUMBER()的运用
但是如果是用dense_rank()开窗做的话, 查询结果出来只有表头没有返回null.
create table Employee (
id number,
salary number
);
insert into Employee values (
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。