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 ?    44 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

671


Can we create foreign key without primary key?

545


which operator is used in query for pattern matching? : Sql dba

560


Is null operator in sql?

617


Difference between truncate, delete and drop commands?

567






Why primary key is required?

571


What is auto increment?

586


What is sql and how does it work?

557


What is difference between my sql and sql?

541


what is 'mysqlshow'? : Sql dba

604


What is a data definition language?

564


What is the difference between inner join and left join?

552


What is pl sql in oracle?

596


What is the difference between partition and index?

493


What is cost in sql execution plan?

498