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

Calculate difference between 2 date / times in oracle sql?

570


Explain the characteristics of oracle dba?

636


How to rename an index?

586


What is an oracle database?

610


How to define an oracle cursor variable?

563






How to define a specific record type?

618


How to create a server parameter file?

571


How can we find out the duplicate values in an oracle table?

606


what is the scenario where you take the database to NoArchivelog mode?

1832


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1260


How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

1468


Explain the use of record option in exp command.

533


How to use in conditions in oracle?

549


Point the difference between translate and replace?

570


What is a relational database management system?

672