how to find the second highest salary from emp table?

Answer Posted / mangesh pardhi

SELECT salary
FROM employee e
WHERE 2=(SELECT COUNT(DISTINCT salary)
FROM employees
WHERE e.salary<=salary)
--replace the number with 2,3,4 u wil find the that position
salary

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the primary key?

529


Why do we use cursors?

502


how to do backup entire database? : Transact sql

603


What are inbuilt functions in sql?

588


How to use distinct and count in sql query? Explain

603






Whis is not false in primary key?

968


Explain the difference between rename and alias?

541


Is null operator in sql?

596


Is pl sql still used?

501


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

503


What is a crud api?

491


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

496


What is the difference between a subquery and a join?

520


what are properties of a transaction? : Sql dba

552


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

504