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

Answer Posted / md valiyullah

select max(sal)-5 from emp where dept = 'sale'
union all
select max(sal)-5 from emp where dept = 'purchase'

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

603


Explain coalesce function?

626


What is an oracle and why it is used?

623


Difference between pre-select and pre-query

576


How to store only time; not date and time?

557






HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.

995


Give the different types of rollback segments.

580


How to export data with a field delimiter?

582


What are the arithmetic operations?

583


what is insert all statement in sql

5518


How to execute a stored program unit?

583


What is the parameter mode that can be passed to a procedure?

574


Where do you use decode and case statements?

554


How to use subqueries with the in operator using oracle?

612


Can select statements be used on views in oracle?

594