首页 >数据库 >mysql教程 >Oracle 基本查询 查看排名

Oracle 基本查询 查看排名

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-07 17:13:101439浏览

1- 求排名前6-10 的员工 方法一: select employee, salary from ( select employee, salary, row_number() over (order by

1- 求排名前6-10 的员工

方法一:

select employee, salary
  from (
    select employee, salary, row_number() over (order by salary desc) r
      from salary_table
  )
where r between 6 and 10;

======================================

方法二:
select employee, salary
  from (
    select employee, salary, rank() over (order by salary desc) r
      from salary_table
  )
where r between 6 and 10;

更多Oracle相关信息见Oracle 专题页面 ?tid=12

linux

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn