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

Answer Posted / omkar hendre

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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by pl/sql packages?

568


What is the use of sql trace?

474


What is difference between left and right outer join?

519


define join and explain different type of joins? : Sql dba

544


What is parameter substitution in sql?

523






What do you mean by “trigger” in sql?

617


What is compound trigger?

553


How long does it take to learn pl sql?

603


Explain the update statement in sql

560


how can we optimize or increase the speed of a mysql select query? : Sql dba

504


How do you rename a table in sql?

532


Can sql function call stored procedure?

556


What is dense_rank in sql?

539


what is 'mysqlcheck'? : Sql dba

573


What is an inconsistent dependency?

579