Find out the 3rd highest salary?

Answer Posted / aarti verma

get the 3rd highest salary:

SELECT DISTINCT salary from employee e ORDER BY salary DESC
LIMIT 2,1;

get the records of employees having 3rd highest salary:

SELECT * FROM employees WHERE salary = (SELECT DISTINCT
salary from employee e ORDER BY salary DESC LIMIT 2,1);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are variables in pl sql?

569


How can I change database name in sql?

532


How to install oracle sql developer?

571


how to get a list of all tables in a database? : Sql dba

513


How does a covering index work?

531






What are the different set operators available in sql?

565


what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

621


what is data manipulation language? : Sql dba

531


Explain table and field in sql?

585


how to create a new table in mysql? : Sql dba

549


What is the use of pl/sql table?

556


What is insert command in sql?

528


explain what is mysql? : Sql dba

600


Advantages and disadvantages of stored procedure?

580


What is a memo field?

529