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

How many postgresql users are there, worldwide?

582


how to rename an existing column in a table? : Sql dba

514


What is scalar and vector?

534


What is pessimistic concurrency control? : Transact sql

590


How to select 10 records from a table?

651






what is the difference between $message and $$message? : Sql dba

552


Why are indexes and views important to an organization?

529


What is a field in a database?

573


What is the difference between pl and sql?

546


What is a trigger in sql?

642


What are the usages of sql?

567


Explian rowid, rownum?

566


Which language is used in sql?

525


How to display the records between two range in Oracle SQL Plus?

645


What is informix sql?

540