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

Answer Posted / gaurav mishra

The answer query is......

Select max(sal) from emp a where (&N-1) in(select count
(distinct(b.sal)) from emp b where a.sal<b.sal);

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a select statement fire a trigger?

664


How can I change database name in sql?

533


what are enums used for in mysql? : Sql dba

614


Explain mutating table error.

651


What is scalar and vector?

534






how can we repair a mysql table? : Sql dba

542


What are the different types of functions in sql?

517


What is orm in sql?

541


Does view contain data?

622


Can we delete column in sql?

565


Mention what are different methods to trace the pl/sql code?

564


What is materialized view. What are different methods of refresh?

788


How is sql used in oracle?

583


What are different types of functions in sql?

513


Is left join same as join?

524