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

Answer Posted / satya_k21

Hi,


Select * from emp e where 2>= (select count(sal) from
emp e where sal>=e.sal) order by desc.

Let me know if it is wrong..


Regards,
Satya.K

Is This Answer Correct ?    11 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to write date and time literals? : Sql dba

536


What is the difference between numeric and autonumber?

502


What is a primary key sql?

565


can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba

539


What is the difference between drop and truncate commands?

492






Can I join the same table twice?

531


Explain the working of foreign key?

551


What is schema in sql example?

601


how to include numeric values in sql statements? : Sql dba

567


Can a procedure in a package be overloaded?

549


Can there be 2 primary keys in a table?

559


What is the difference between rollback and rollback to statements?

586


What is the unique index?

530


What are all the different normalizations?

591


How to write a query to show the details of a student from students table whose

542