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

Answer Posted / praveen marigaddi.

select distinct sal from emp a where 5 >(select count
(distinct sal) from emp where sal>a.sal) order by a.sal desc

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain implicit cursor.

569


What is flashback in Oracle?

589


What is tns entry?

637


How to define default values for formal parameters?

607


Design database draw er diagram for a certain scenario ?

4109






What is a sub query and what are the different types of subqueries?

634


How to assign query results to variables?

599


If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

1665


what is reindexing?

1186


Explain the difference between a procedure and a function? What do you understand by those terms?

633


What are the uses of Database Trigger ?

1124


How to manage transaction isolation level?

578


Can you have more than one content canvas view attached with a window ?

1824


How will you differentiate between varchar & varchar2?

596


Why does Oracle not permit the use of PCTUSED with indexes?

1964