How to retrieve 5th highest sal from emp table?

Answer Posted / venkata

hi, earlier query return sal in asending order and when
duplicate salries are there the earlier highest salary
position returns no rows. I hope this is better query.


select * from (select * from emp order by sal desc)
group by
rownum,empno,ename,job,mgr,hiredate,sal,comm,deptno having
rownum=&n

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are dml statements in oracle?

623


Can you assign multiple query result rows to a variable?

551


normally database take to refresh time 2 hours. but client asked iwant to refresh with in 5 min that same database. do you have any option in BO and Oracle? explain me briefly...kavi

1744


How do I escape a reserved word in oracle?

632


How to build data dictionary view an new database?

532






Explain what are the advantages of views?

613


How to view the tablespaces in the current database?

561


How to get last row id?

557


What are the restrictions on external table columns?

552


What is the difference between postgresql and oracle?

508


How to declare a local variable?

596


Explain the function of optimizer in oracle?

599


How to define a sub function?

669


What is the meaning of recursive hints in oracle?

532


How to use subqueries with the in operator using oracle?

614