oracle 罗纳姆没有工作在发现最高工资[副本]

pkwftd7m  于 2023-08-04  发布在  Oracle
关注(0)|答案(1)|浏览(78)

此问题在此处已有答案

Selecting the second row of a table using rownum(10个答案)
29天前关闭
select * from(select * from(select emp_salary from employee order by emp_salary)where rownum<6 order by emp_salary)where rownum =6;
在上面的查询rownum是不工作,如果我将运行下面的查询然后rownum是工作,我感到困惑,请帮助
select * from(select * from(select emp_salary from employee order by emp_salary)where rownum<6 order by emp_salary)where rownum =1;
select * from(select * from(select emp_salary from employee order by emp_salary)where rownum<6 order by emp_salary)where rownum =1;

tvokkenx

tvokkenx1#

你可以试试:

select * 
   from (
         select rownum as num_row, x.* 
           from (
                 select emp_salary 
                   from employee 
                  order by emp_salary
                ) x
          where rownum <= 6 
          order by emp_salary
        ) 
  where num_row = 6;

字符串

  • 谢谢-谢谢

相关问题