how to findout the 100th maximum salary

Answer Posted / srinu

Hi Jyothi,

The below q uery is suitable for Nth max salary....

SELECT a.sal
FROM emp a
WHERE &N=(SELECT COUNT(DISTINCT b.sal)
FROM emp b
WHERE a.sal<=b.sal);
In the above query u can substitute any value like 1,2,..100 etc instead of &n.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between drop and truncate commands?

700


How can I speed up sql query?

704


What is a sql driver?

691


List the various privileges that a user can grant to another user?

771


How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?

811






What is difference between sql and oracle?

772


How many sql statements are used? Define them.

774


What is where clause in sql?

733


What are different clauses used in sql?

811


State few characteristics of pl/sql?

722


What does plv msg allows you to do?

859


Explain the methods used to protect source code of pl/sql.

732


What type of join is sql join?

719


What is an emotional trigger?

689


what tools available for managing mysql server? : Sql dba

745