how will I find the first 5 highest salaried employees in
each dept in oracle.

Answer Posted / ravindra reddy

select *from(select b.* from emp b order by sal desc)where rownum<=5 order by sal desc
------------------------------------------------------------
select *from(select b.*,rank() over(order by sal desc) from emp b)where rownum<=5

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

We are using Oracle apps with XML publisher.In that,we are facing some problems while giving a Footer in RTF Template.While giving a footer in RTF Template it is Visible in all the pages,but after the PDF is getiing generated,the Footer are Visible on alternate pages only (like on first page ,third page) and so on. Please provide the Solution for getting the Footer on all the pages.

4924


What is translate in oracle?

613


How do I start tns listener?

530


How to call a stored function with parameters?

555


How to delete a column in an existing table in oracle?

591






In Oracle Applications We are Using Sub Ledger Accounting. When we Transfer the Data all modules (AP,AR,CE,FA) to SLA We done Some customizations? What are They??

1358


 How to use an oracle sequence generator in a mapping?

556


How translate command is different from replace?

542


How many file formats are supported to export data?

649


Explain the use of indexes option in imp command.

560


What is an Oracle index?

1170


How to assign a table row to a record variable?

574


How to write a query with a left outer join in oracle?

597


What is the maximum limit on the number of columns in a table?

545


List the parts of a database trigger.

563