Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / anil_abbireddy

select * from emp a where 2=(select count(distinct sal)
from emp b where a.sal<=b.sal)

Is This Answer Correct ?    30 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are its different types of dbms?

525


What are pl/sql cursors?

553


What is difference between nchar and nvarchar?

531


Enlist some predefined exceptions?

565


What is the difference between count 1 and count (*) in a sql query?

487






What is sql integrity?

570


How does left join work in sql?

503


What are two statement types in sql?

526


Explain lock escalation? : Transact sql

691


Mention what does plv msg allows you to do?

655


What is the difference between jpql and sql?

540


How do I remove sql developer from windows 10?

497


What is integrity in sql?

543


What is where clause in sql?

516


Define a temp table?

539