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

Why stored procedure is faster than query?

605


How do you write an index?

621


Explain dml and ddl?

642


What is plpgsql language?

618


What is the difference between left join and right join?

582






what is 'trigger' in sql? : Sql dba

651


Name the operator which is used in the query for pattern matching?

595


Explain two easy sql optimizations.

692


What is the meaning of disabling a trigger?

727


Which is faster truncate or drop?

660


What is sql trigger example?

646


What is cartesian join in sql?

647


Show how functions and procedures are called in a pl/sql block.

685


What does the base_object_type column shows in the user.triggers data dictionary view?

665


What is a sql driver?

607