Answers

Question and Answer:

  Home  Oracle D2K

⟩ How to get / select the nth row from the table? how to select first n rows ,last n rows from a table?

nth salary

select salary

from table_name a

where &n=(select count(salary) from table_name b where a.salary<=b.salary);

n salaries

select salary

from table_name a

where &n>=(select count(salary) from table_name b where a.salary<=b.salary);

select level,max(column name) from emp where level = n connect by prior sal > sal group by level;

 208 views

More Questions for you: