由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - [合集] To get the 2nd, 3rd, 4th largest value
相关主题
To get the 2nd, 3rd, 4th largest valueprimary key?
[合集] Stored Procedure的Is和As有什么区别,还有 ······Special character in insert values
[合集] 问一个Oralce index的问题如何在oracle8i中得到视图和表的定义?
问一道sql的面试题啊 自己实在是没想出来请教一个问题
请教oracle select top 10 from ... order by descSQL问题
给大家贡献一个fb面试的sql问题纪录查找问题
[合集] 数据库这门课值得学吗?column in table point to another table
Expert Oracle dba: monthly salary range:$5010 – $6575oracle中如何查询已建立的表结构
相关话题的讨论汇总
话题: largest话题: salary话题: value话题: rn话题: wed
进入Database版参与讨论
1 (共1页)
E**i
发帖数: 116
1
☆─────────────────────────────────────☆
yiyayiyayo (Mera naam Itiaan hai) 于 (Wed May 16 23:34:48 2007) 提到:
It is pretty easy to get the largest value of a field. e.g.:
select max(salary) from employees;
How do you get the 2nd largest value? Or the 3rd largest?
Do this:
select salary, rn from
(select salary, row_number() over (order by salary desc) rn
from employees) x
where rn=2;
☆─────────────────────────────────────☆
q101 (^(?:[DX]?HT|X|YA)ML$) 于 (Wed May 16 23:44:23 2007) 提到:
1 (共1页)
进入Database版参与讨论
相关主题
oracle中如何查询已建立的表结构请教oracle select top 10 from ... order by desc
Help about a SQL statement给大家贡献一个fb面试的sql问题
Oracle下如何能得到所有table的名字?[合集] 数据库这门课值得学吗?
servlet调用sql 访问oracle的问题Expert Oracle dba: monthly salary range:$5010 – $6575
To get the 2nd, 3rd, 4th largest valueprimary key?
[合集] Stored Procedure的Is和As有什么区别,还有 ······Special character in insert values
[合集] 问一个Oralce index的问题如何在oracle8i中得到视图和表的定义?
问一道sql的面试题啊 自己实在是没想出来请教一个问题
相关话题的讨论汇总
话题: largest话题: salary话题: value话题: rn话题: wed