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

Answer Posted / rajesh

Guess this works...

select max(sal)
from (select * from emp
where sal not in (select max(sal) from emp))

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 top in tsql? : Transact sql

549


What does the hierarchical profiler does?

570


What is 19 null in sql?

536


how many sql dml commands are supported by 'mysql'? : Sql dba

572


What is the use of sql trace?

481






What does rownum mean in sql?

558


What is sql indexing?

557


How can you create an empty table from an existing table?

598


how to get @@error and @@rowcount at the same time? : Sql dba

533


What are the two types of exceptions.

639


What is rank dense_rank and partition in sql?

541


How we can update the view?

605


How can I make sql query run faster?

564


Can delete statement be rollbacked?

529


how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba

513