find out the third highest salary?

Answer Posted / suresh kumar

Hi every body,

I give the standard format Query for this type of top most
and who are the top n people in the organization like that

If we take EMP table

Select * from EMP A where &n= (select count (distinct
(sal)) from EMP B where B.sal>A.sal)

If we give n value 1 or 2 or 3….etc then we gets top one,
top second, and top third person details.

This same query can we use top n people who are earning
maximum salaries in the Organization

Select * from EMP A where &n> (select count (distinct
(sal)) from EMP B where B.sal>A.sal)

Is This Answer Correct ?    38 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between truncate and delete?

551


What privilege is needed for a user to create tables in oracle?

544


How to bring a tablespace online?

510


What is an oracle table?

548


Please explain me all types of Data models. Also give me the details if each model can have other name.for example:schematic data model is also known as conceptual data model and entity relation data model.

1857






Explain the use of online redo log files in oracle.

575


What is the data pump import utility?

573


Why do I get unexpected characters from 8-bit character sets in weblogic jdriver for oracle?

602


What are the various types of snapshots ?

555


How a database is related to tablespaces?

571


how do u setup a replication site?

1488


Whether any commands are used for months calculation? If so, what are they?

582


How will you write a query to get a 5th rank student from a table student_report?

1353


what are the default admin accounts in Oracle 10g ?

501


State and explain the different types of data models?

525